get_the_author

Retrieve the author of the current post.

Description

(string|null) get_the_author( (string) $deprecated = '' ); 

Returns (string|null)

The author's display name.

Parameters (1)

0. $deprecated — Optional. (string) => ''
The deprecated.

Usage

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

Defined (1)

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

/wp-includes/author-template.php  
  1. function get_the_author($deprecated = '') { 
  2. global $authordata; 
  3.  
  4. if ( !empty( $deprecated ) ) 
  5. _deprecated_argument( __FUNCTION__, '2.1.0' ); 
  6.  
  7. /** 
  8. * Filters the display name of the current post's author. 
  9. * @since 2.9.0 
  10. * @param string $authordata->display_name The author's display name. 
  11. */ 
  12. return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);