Warning: This function has been deprecated.

get_user_metavalues() WordPress Function

The get_user_metavalues() function allows you to get the user metadata values for a given user. This function can be used to get any user metadata value, including custom values set by plugins and themes.

get_user_metavalues( array $ids ) #

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


Parameters

$ids

(array)(Required)User ID numbers list.


Top ↑

Return

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


Top ↑

Source

File: wp-includes/deprecated.php

function get_user_metavalues($ids) {
	_deprecated_function( __FUNCTION__, '3.3.0' );

	$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;
}


Top ↑

Changelog

Changelog
VersionDescription
3.3.0This function has been deprecated.
3.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More