Advertisements

get_user_metavalues

Definition:
function get_user_metavalues($ids) {}

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

Parameters

  • array $ids: User ID numbers list.

Return values

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

Source code

function get_user_metavalues($ids) {

	_deprecated_function( __FUNCTION__, '3.3' );



	$objects = array();



	$ids = array_map('intval', $ids);

	foreach ( $ids as $id )

		$objects[$id] = array();



	$metas = update_meta_cache('user', $ids);



	foreach ( $metas as $id => $meta ) {

		foreach ( $meta as $key => $metavalues ) {

			foreach ( $metavalues as $value ) {

				$objects[$id][] = (object)array( 'user_id' => $id, 'meta_key' => $key, 'meta_value' => $value);

			}

		}

	}



	return $objects;

}

16510

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: