On this page
get_profile( string $field, false|int $user = false ): string
This function has been deprecated. Use get_the_author_meta() instead.
Retrieve user data based on field.
Description
See also
Parameters
$fieldstring Required-
User meta field.
$userfalse|int Optional-
User ID to retrieve the field for. Default false (current user).
Default:
false
Return
string The author's field from the current author's DB object.
Source
File: wp-includes/deprecated.php. View all references
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 );
}
Related
Uses
| Uses | Description |
|---|---|
| get_user_by() wp-includes/pluggable.php | Retrieves user info by a given field. |
| get_the_author_meta() wp-includes/author-template.php | Retrieves the requested data of the author of the current post. |
| _deprecated_function() wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Use get_the_author_meta() |
| 1.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_profile