get_user_metavalues() - WordPress 函数参考中文文档

返回介绍

get_user_metavalues()

发布于 2017-09-11 字数 1704 浏览 1018 评论 0

Warning: This function has been deprecated.

get_user_metavalues( array $ids )

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


描述


参数

$ids

(array)
(Required)
User ID numbers list.


返回值

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


源代码

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

更新日志

Version 描述
3.3.0 This function has been deprecated.
3.0.0 Introduced.

相关函数

Uses

  • wp-includes/functions.php:
    _deprecated_function()
  • wp-includes/meta.php:
    update_meta_cache()

User Contributed Notes

上一篇:get_user_meta()

下一篇:get_user_option()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!