get_profile()

最后更新于:2021-11-26 23:18:09

get_profile( string$field, false|int$user=false)

Retrieve user data based on field.

参数

$field

(string) (Required) User meta field.

$user

(false|int) (Optional) User ID to retrieve the field for. Default false (current user).

Default value: false

响应

(string) The author’s field from the current author’s DB object.

源文件

文件: gc-includes/deprecated.php

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