WordPress开发者和主题制作者的搜索引擎



get_user_meta ›

Since3.0.0
已弃用n/a
get_user_meta ( $user_id, $key = '', $single = false )
参数: (3)
  • (int) $user_id User ID.
    Required: Yes
  • (string) $key Optional. The meta key to retrieve. By default, returns data for all keys.
    Required: No
    默认: (empty)
  • (bool) $single Whether to return a single value.
    Required: No
    默认: false
链接:
返回:
  • (mixed) Will be an array if $single is false. Will be value of meta data field if $single is true.
定义在:
文档:

Retrieve user meta field for a user.



源码

function get_user_meta( $user_id, $key = '', $single = false ) {
	return get_metadata( 'user', $user_id, $key, $single );
}