columns – the_modified_author() returning blank
Question
I’m attempting to display custom columns that return the last modified date and the author that updated it.
function rh_custom_page_columns( $columns ) {
$columns['last_modified'] = 'Last modified';
$columns['modified_author'] = 'Modified by';
return $columns;
}
add_filter('manage_pages_columns','rh_custom_page_columns');
function rh_custom_columns_date_author ( $column_id, $post_id ) {
switch( $column_id ) {
case 'last_modified':
echo get_post_field('post_modified', $post_id);
break;
case 'modified_author':
echo the_modified_author();
break;
}
}
add_action( 'manage_pages_custom_column','rh_custom_columns_date_author', 10, 2 );
the_modified_author()
doesn’t return any value even though the author exists as a user. I’ve also tried get_the_modified_author()
that outputs and empty value too.
How else can I display the author that modified the page (and not the author had originally published it)?
Researching it further, there seems to be a bug? with the function – https://wordpress.org/support/topic/get_the_modified_author-not-working/
0
3 weeks
2023-05-06T22:44:25-05:00
2023-05-06T22:44:25-05:00 0 Answers
0 views
0
Leave an answer