To get the_modified_author()
we have to look in the folder wp-includes and search for the author-template.php.
Line 101 shows:
/**
* Display the name of the author who last edited the current post,
* if the author's ID is available.
*
* @since 2.8.0
*
* @see get_the_author()
*/
function the_modified_author() {
echo get_the_modified_author();
}
You can use: <?php echo get_the_modified_author(); ?>
To get the_modified_date();
we will have to take a look in the same folder (wp-includes) and find the file general-template.php.
Line 2251 shows:
/**
* Retrieve the date on which the post was last modified.
*
* @since 2.1.0
*
* @param string $d Optional. PHP date format. Defaults to the "date_format" option
* @return string
*/
function get_the_modified_date($d = '') {
if ( '' == $d )
$the_time = get_post_modified_time(get_option('date_format'), null, null, true);
else
$the_time = get_post_modified_time($d, null, null, true);
/**
* Filter the date a post was last modified.
*
* @since 2.1.0
*
* @param string $the_time The formatted date.
* @param string $d PHP date format. Defaults to value specified in
* 'date_format' option.
*/
return apply_filters( 'get_the_modified_date', $the_time, $d );
}
You can use: <?php echo get_the_modified_date(); ?>
Please see for more detail:
the_modified_author();
the_modified_date();
To get the url from the author which has modified the post as last I suggest to use a function
.
(please make first a backup of functions.php and then add this function)
/**
* Return the URL of the author (who modified post as last)
* Codex: {@link https://developer.wordpress.org/reference/functions/get_post_meta/}
* {@link https://codex.wordpress.org/Function_Reference/get_author_posts_url}
*
* @version WordPress 4.6
*/
function wpse_238105_modified_author_posts_url()
{
global $post;
// Get the ID of the author(meta: _edit_last)
if ( $id = get_post_meta($post->ID, '_edit_last', true ) )
{
// return URL
echo get_author_posts_url( $id );
}
} // end function
Note: see the @link urls in the function above for references.
You can now use it as following in a template:
Last modified by <a href="https://wordpress.stackexchange.com/questions/238105/<?php wpse_238105_modified_author_posts_url(); ?>"><?php the_modified_author(); ?> </a> on <?php the_modified_date(); ?>
The name of the author who has modified the post as last is now ‘clickable’.