get_profile

函数


get_profile ( $field, $user = false )
参数
  • (string)
    $field
    User meta field.
    Required:
  • (false|int)
    $user
    Optional. User ID to retrieve the field for. Default false (current user).
    Required:
    Default: false
返回值
  • (string) The author’s field from the current author’s DB object.
相关
  • get_the_author_meta()
定义位置
  • wp-includes/deprecated.php
    , line 2419
引入
1.5.0
弃用
3.0.0

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