get_user_metavalues

Perform the query to get the $metavalues array(s) needed by _fill_user and _fill_many_users.

Description

(array) get_user_metavalues( (array) $ids ); 

Returns (array)

of arrays. The array is indexed by user_id, containing $metavalues object arrays.

Parameters (1)

0. $ids (array)
User ID numbers list.

Usage

  1. if ( !function_exists( 'get_user_metavalues' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // User ID numbers list. 
  5. $ids = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_user_metavalues($ids); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function get_user_metavalues($ids) { 
  2. _deprecated_function( __FUNCTION__, '3.3.0' ); 
  3.  
  4. $objects = array(); 
  5.  
  6. $ids = array_map('intval', $ids); 
  7. foreach ( $ids as $id ) 
  8. $objects[$id] = array(); 
  9.  
  10. $metas = update_meta_cache('user', $ids); 
  11.  
  12. foreach ( $metas as $id => $meta ) { 
  13. foreach ( $meta as $key => $metavalues ) { 
  14. foreach ( $metavalues as $value ) { 
  15. $objects[$id][] = (object)array( 'user_id' => $id, 'meta_key' => $key, 'meta_value' => $value); 
  16.  
  17. return $objects;