get_user_metavalues

The timeline below displays how wordpress function get_user_metavalues has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 4.6

/**
 * Perform the query to get the $metavalues array(s) needed by _fill_user and _fill_many_users
 *
 * @since 3.0.0
 * @deprecated 3.3.0
 *
 * @param array $ids User ID numbers list.
 * @return array of arrays. The array is indexed by user_id, containing $metavalues object arrays.
 */
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;
}

WordPress Version: 3.7

/**
 * Perform the query to get the $metavalues array(s) needed by _fill_user and _fill_many_users
 *
 * @since 3.0.0
 * @deprecated 3.3.0
 *
 * @param array $ids User ID numbers list.
 * @return array of arrays. The array is indexed by user_id, containing $metavalues object arrays.
 */
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;
}