get_user_metavalues

函数


get_user_metavalues ( $ids )
参数
  • (array)
    $ids
    User ID numbers list.
    Required:
返回值
  • (array) of arrays. The array is indexed by user_id, containing $metavalues object arrays.
定义位置
  • wp-includes/deprecated.php
    , line 2604
引入
3.0.0
弃用
3.3.0

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

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;
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。