get_the_modified_author

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

WordPress Version: 6.1

/**
 * Retrieves the author who last edited the current post.
 *
 * @since 2.8.0
 *
 * @return string|void The author's display name, empty string if unknown.
 */
function get_the_modified_author()
{
    $last_id = get_post_meta(get_post()->ID, '_edit_last', true);
    if ($last_id) {
        $last_user = get_userdata($last_id);
        /**
         * Filters the display name of the author who last edited the current post.
         *
         * @since 2.8.0
         *
         * @param string $display_name The author's display name, empty string if unknown.
         */
        return apply_filters('the_modified_author', $last_user ? $last_user->display_name : '');
    }
}

WordPress Version: 5.5

/**
 * Retrieve the author who last edited the current post.
 *
 * @since 2.8.0
 *
 * @return string|void The author's display name.
 */
function get_the_modified_author()
{
    $last_id = get_post_meta(get_post()->ID, '_edit_last', true);
    if ($last_id) {
        $last_user = get_userdata($last_id);
        /**
         * Filters the display name of the author who last edited the current post.
         *
         * @since 2.8.0
         *
         * @param string $display_name The author's display name.
         */
        return apply_filters('the_modified_author', $last_user->display_name);
    }
}

WordPress Version: 5.1

/**
 * Retrieve the author who last edited the current post.
 *
 * @since 2.8.0
 *
 * @return string|void The author's display name.
 */
function get_the_modified_author()
{
    $last_id = get_post_meta(get_post()->ID, '_edit_last', true);
    if ($last_id) {
        $last_user = get_userdata($last_id);
        /**
         * Filters the display name of the author who last edited the current post.
         *
         * @since 2.8.0
         *
         * @param string $last_user->display_name The author's display name.
         */
        return apply_filters('the_modified_author', $last_user->display_name);
    }
}

WordPress Version: 4.6

/**
 * Retrieve the author who last edited the current post.
 *
 * @since 2.8.0
 *
 * @return string|void The author's display name.
 */
function get_the_modified_author()
{
    if ($last_id = get_post_meta(get_post()->ID, '_edit_last', true)) {
        $last_user = get_userdata($last_id);
        /**
         * Filters the display name of the author who last edited the current post.
         *
         * @since 2.8.0
         *
         * @param string $last_user->display_name The author's display name.
         */
        return apply_filters('the_modified_author', $last_user->display_name);
    }
}

WordPress Version: 4.3

/**
 * Retrieve the author who last edited the current post.
 *
 * @since 2.8.0
 *
 * @return string|void The author's display name.
 */
function get_the_modified_author()
{
    if ($last_id = get_post_meta(get_post()->ID, '_edit_last', true)) {
        $last_user = get_userdata($last_id);
        /**
         * Filter the display name of the author who last edited the current post.
         *
         * @since 2.8.0
         *
         * @param string $last_user->display_name The author's display name.
         */
        return apply_filters('the_modified_author', $last_user->display_name);
    }
}

WordPress Version: 4.1

/**
 * Retrieve the author who last edited the current post.
 *
 * @since 2.8.0
 *
 * @return string The author's display name.
 */
function get_the_modified_author()
{
    if ($last_id = get_post_meta(get_post()->ID, '_edit_last', true)) {
        $last_user = get_userdata($last_id);
        /**
         * Filter the display name of the author who last edited the current post.
         *
         * @since 2.8.0
         *
         * @param string $last_user->display_name The author's display name.
         */
        return apply_filters('the_modified_author', $last_user->display_name);
    }
}

WordPress Version: 3.9

/**
 * Retrieve the author who last edited the current post.
 *
 * @since 2.8.0
 *
 * @uses $post The current post's DB object.
 * @uses get_post_meta() Retrieves the ID of the author who last edited the current post.
 * @uses get_userdata() Retrieves the author's DB object.
 * @uses apply_filters() Calls 'the_modified_author' hook on the author display name.
 * @return string The author's display name.
 */
function get_the_modified_author()
{
    if ($last_id = get_post_meta(get_post()->ID, '_edit_last', true)) {
        $last_user = get_userdata($last_id);
        /**
         * Filter the display name of the author who last edited the current post.
         *
         * @since 2.8.0
         *
         * @param string $last_user->display_name The author's display name.
         */
        return apply_filters('the_modified_author', $last_user->display_name);
    }
}

WordPress Version: 3.7

/**
 * Retrieve the author who last edited the current post.
 *
 * @since 2.8
 * @uses $post The current post's DB object.
 * @uses get_post_meta() Retrieves the ID of the author who last edited the current post.
 * @uses get_userdata() Retrieves the author's DB object.
 * @uses apply_filters() Calls 'the_modified_author' hook on the author display name.
 * @return string The author's display name.
 */
function get_the_modified_author()
{
    if ($last_id = get_post_meta(get_post()->ID, '_edit_last', true)) {
        $last_user = get_userdata($last_id);
        /**
         * Filter the display name of the author who last edited the current post.
         *
         * @since 2.8.0
         *
         * @param string $last_user->display_name The author's display name.
         */
        return apply_filters('the_modified_author', $last_user->display_name);
    }
}