WordPress Version: 6.3
/**
* Author Template functions for use in themes.
*
* These functions must be used within the WordPress Loop.
*
* @link https://codex.wordpress.org/Author_Templates
*
* @package WordPress
* @subpackage Template
*/
/**
* Retrieves the author of the current post.
*
* @since 1.5.0
* @since 6.3.0 Returns an empty string if the author's display name is unknown.
*
* @global WP_User $authordata The current author's data.
*
* @param string $deprecated Deprecated.
* @return string The author's display name, empty string if unknown.
*/
function get_the_author($deprecated = '')
{
global $authordata;
if (!empty($deprecated)) {
_deprecated_argument(__FUNCTION__, '2.1.0');
}
/**
* Filters the display name of the current post's author.
*
* @since 2.9.0
*
* @param string $display_name The author's display name.
*/
return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : '');
}