get_profile

Retrieve user data based on field.

Description

(string) get_profile( (string) $field, (bool) $user = false ); 

Returns (string)

The author's field from the current author's DB object.

Parameters (2)

0. $field (string)
User meta field.
1. $user — Optional. (bool) => false
User ID to retrieve the field for. Default false (current user).

Usage

  1. if ( !function_exists( 'get_profile' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // User meta field. 
  5. $field = ''; 
  6.  
  7. // Optional. User ID to retrieve the field for. Default false (current user). 
  8. $user = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = get_profile($field, $user); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function get_profile( $field, $user = false ) { 
  2. _deprecated_function( __FUNCTION__, '3.0.0', 'get_the_author_meta()' ); 
  3. if ( $user ) { 
  4. $user = get_user_by( 'login', $user ); 
  5. $user = $user->ID; 
  6. return get_the_author_meta( $field, $user );