the_author_meta

Outputs the field from the user's DB object.

Description

the_author_meta( (string) $field = '', (bool) $user_id = false ); 

Defaults to current post's author.

Parameters (2)

0. $field — Optional. (string) => ''
Selects the field of the users record.
1. $user_id — Optional. (bool) => false
User ID.

Usage

  1. if ( !function_exists( 'the_author_meta' ) ) { 
  2. require_once ABSPATH . WPINC . '/author-template.php'; 
  3.  
  4. // selects the field of the users record. 
  5. $field = ''; 
  6.  
  7. // Optional. User ID. 
  8. $user_id = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = the_author_meta($field, $user_id); 
  12.  

Defined (1)

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

/wp-includes/author-template.php  
  1. function the_author_meta( $field = '', $user_id = false ) { 
  2. $author_meta = get_the_author_meta( $field, $user_id ); 
  3.  
  4. /** 
  5. * The value of the requested user metadata. 
  6. * The filter name is dynamic and depends on the $field parameter of the function. 
  7. * @since 2.8.0 
  8. * @param string $author_meta The value of the metadata. 
  9. * @param int $user_id The user ID. 
  10. */ 
  11. echo apply_filters( 'the_author_' . $field, $author_meta, $user_id );