根据字段检索用户数据。
原型
get_profile( string $field, false|int $user = false )
参数
$field
(string)
(Required)
用户元字段。
$user
(false|int)
(Optional)
用于检索字段的用户ID。默认为false(当前用户)。
返回值
(string)
作者的字段来自当前作者的DB对象。
源文件
路径:wp-includes/deprecated.php
<?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 );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/get_profile/