get_author_name

Retrieve the specified author's preferred display name.

Description

(string) get_author_name( (bool) $auth_id = false ); 

Returns (string)

The author's display name.

Parameters (1)

0. $auth_id — Optional. (bool) => false
The ID of the author.

Usage

  1. if ( !function_exists( 'get_author_name' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // The ID of the author. 
  5. $auth_id = false; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_author_name($auth_id); 
  9.  

Defined (1)

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

/wp-includes/deprecated.php  
  1. function get_author_name( $auth_id = false ) { 
  2. _deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'display_name\')' ); 
  3. return get_the_author_meta('display_name', $auth_id);