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



get_profile › WordPress Function

Since1.5.0
已弃用3.0.0
get_profile ( $field, $user = false )
参数: (2)
  • (string) $field User meta field.
    Required: Yes
  • (false|int) $user Optional. User ID to retrieve the field for. Default false (current user).
    Required: No
    默认: false
查看:
返回:
  • (string) The author's field from the current author's DB object.
定义在:
文档:

Retrieve user data based on field.



源码

function get_profile( $field, $user = false ) {
	_deprecated_function( __FUNCTION__, '3.0.0', 'get_the_author_meta()' );
	if ( $user ) {
		$user = get_user_by( 'login', $user );
		$user = $user->ID;
	}
	return get_the_author_meta( $field, $user );
}