get_the_author

The timeline below displays how wordpress function get_the_author has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

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 : '');
}

WordPress Version: 6.1

/**
 * 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
 *
 * @global WP_User $authordata The current author's data.
 *
 * @param string $deprecated Deprecated.
 * @return string|null The author's display name.
 */
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|null $display_name The author's display name.
     */
    return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
}

WordPress Version: 5.5

/**
 * 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
 */
/**
 * Retrieve the author of the current post.
 *
 * @since 1.5.0
 *
 * @global WP_User $authordata The current author's data.
 *
 * @param string $deprecated Deprecated.
 * @return string|null The author's display name.
 */
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|null $display_name The author's display name.
     */
    return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
}

WordPress Version: 4.6

/**
 * 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
 */
/**
 * Retrieve the author of the current post.
 *
 * @since 1.5.0
 *
 * @global object $authordata The current author's DB object.
 *
 * @param string $deprecated Deprecated.
 * @return string|null The author's display name.
 */
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 $authordata->display_name The author's display name.
     */
    return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
}

WordPress Version: 4.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
 */
/**
 * Retrieve the author of the current post.
 *
 * @since 1.5.0
 *
 * @global object $authordata The current author's DB object.
 *
 * @param string $deprecated Deprecated.
 * @return string|null The author's display name.
 */
function get_the_author($deprecated = '')
{
    global $authordata;
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.1');
    }
    /**
     * Filter the display name of the current post's author.
     *
     * @since 2.9.0
     *
     * @param string $authordata->display_name The author's display name.
     */
    return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
}

WordPress Version: 4.2

/**
 * 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
 */
/**
 * Retrieve the author of the current post.
 *
 * @since 1.5.0
 *
 * @uses $authordata The current author's DB object.
 *
 * @param string $deprecated Deprecated.
 * @return string The author's display name.
 */
function get_the_author($deprecated = '')
{
    global $authordata;
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.1');
    }
    /**
     * Filter the display name of the current post's author.
     *
     * @since 2.9.0
     *
     * @param string $authordata->display_name The author's display name.
     */
    return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
}

WordPress Version: 4.1

/**
 * Author Template functions for use in themes.
 *
 * These functions must be used within the WordPress Loop.
 *
 * @link http://codex.wordpress.org/Author_Templates
 *
 * @package WordPress
 * @subpackage Template
 */
/**
 * Retrieve the author of the current post.
 *
 * @since 1.5.0
 *
 * @uses $authordata The current author's DB object.
 *
 * @param string $deprecated Deprecated.
 * @return string The author's display name.
 */
function get_the_author($deprecated = '')
{
    global $authordata;
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.1');
    }
    /**
     * Filter the display name of the current post's author.
     *
     * @since 2.9.0
     *
     * @param string $authordata->display_name The author's display name.
     */
    return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
}

WordPress Version: 3.9

/**
 * Author Template functions for use in themes.
 *
 * These functions must be used within the WordPress Loop.
 *
 * @link http://codex.wordpress.org/Author_Templates
 *
 * @package WordPress
 * @subpackage Template
 */
/**
 * Retrieve the author of the current post.
 *
 * @since 1.5.0
 *
 * @uses $authordata The current author's DB object.
 * @uses apply_filters() Calls 'the_author' hook on the author display name.
 *
 * @param string $deprecated Deprecated.
 * @return string The author's display name.
 */
function get_the_author($deprecated = '')
{
    global $authordata;
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.1');
    }
    /**
     * Filter the display name of the current post's author.
     *
     * @since 2.9.0
     *
     * @param string $authordata->display_name The author's display name.
     */
    return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
}

WordPress Version: 3.7

/**
 * Author Template functions for use in themes.
 *
 * These functions must be used within the WordPress Loop.
 *
 * @link http://codex.wordpress.org/Author_Templates
 *
 * @package WordPress
 * @subpackage Template
 */
/**
 * Retrieve the author of the current post.
 *
 * @since 1.5
 * @uses $authordata The current author's DB object.
 * @uses apply_filters() Calls 'the_author' hook on the author display name.
 *
 * @param string $deprecated Deprecated.
 * @return string The author's display name.
 */
function get_the_author($deprecated = '')
{
    global $authordata;
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.1');
    }
    /**
     * Filter the display name of the current post's author.
     *
     * @since 2.9.0
     *
     * @param string $authordata->display_name The author's display name.
     */
    return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
}