Retrieve user data based on field.
Description
See also
Parameters
$fieldstringrequired- User meta field.
$userfalse|intoptional- User ID to retrieve the field for. Default false (current user).
Default:
false
Source
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 );
}
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Use get_the_author_meta() |
| 1.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.