• In the list of posts (and pages), show not only the post author but also the latest post editor, please.

    It would help me to co-work with my SEO, checking the posts he changed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator threadi

    (@threadi)

    Hi,

    Yes, this can be added with a small custom code snippet. WordPress stores the user ID of the last editor in the _edit_last post meta.

    You can add a custom Last Editor column to the Posts and Pages admin lists using the manage_posts_columns / manage_pages_columns filters and their corresponding custom-column hooks.

    For example, for Posts:

    add_filter( 'manage_posts_columns', function ( $columns ) {
        $columns['last_editor'] = __( 'Last Editor', 'textdomain' );
        return $columns;
    } );
    
    add_action( 'manage_posts_custom_column', function ( $column, $post_id ) {
        if ( 'last_editor' === $column ) {
            $editor_id = get_post_meta( $post_id, '_edit_last', true );
    
            if ( $editor_id ) {
                $editor = get_userdata( $editor_id );
    
                if ( $editor ) {
                    echo esc_html( $editor->display_name );
                }
            }
        }
    }, 10, 2 );
    

    A similar approach can be used for Pages with manage_pages_columns and manage_pages_custom_column.

    This would show the latest editor alongside the original post author in the WordPress admin list. The _edit_last value is updated when a post is edited, so it is suitable for identifying who last modified the post.
    SS: https://prnt.sc/6QMY5F7Y12FL

    I hope this helps.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.