get_user_metavalues( array $ids ): array

In this article

This function has been deprecated.

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

Parameters

$idsarrayrequired
User ID numbers list.

Return

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

Source

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

Changelog

VersionDescription
3.3.0This function has been deprecated.
3.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.