Function Reference/get profile

This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php.
Use get_the_author_meta instead.

Contents

Description

Retrieve user data based on field.

Use get_profile() will make a database query to get the value of the table column. The value might be cached using the query cache, but care should be taken when using the function to not make a lot of queries for retrieving user profile information.

If the $user parameter is not used, then the user will be retrieved from a cookie of the user. Therefore, if the cookie does not exist, then no value might be returned. Sanity checking must be done to ensure that when using get_profile() that (empty|null|false) values are handled and that something is at least displayed.

Usage

<?php get_profile( $field, $user ); ?>

Parameters

$field

(string) (required) User field to retrieve. See users table for possible $field values.

Default: None

$user

(string) (optional) User username. Uses user cookie to determine user if this is false or omitted.