Make WordPress Core

Changeset 52141


Ignore:
Timestamp:
11/11/2021 07:07:52 PM (3 years ago)
Author:
davidbaumwald
Message:

Posts, Post Types: Update _edit_last meta when posts are edited in bulk.

When posts are edited in bulk, the _edit_last meta was not updated for each post. This change adds a call to update the _edit_last meta to the current user ID for each post the is updated.

Props calebwoodbridge, peterwilsoncc, guillaumeturpin, audrasjb.
Fixes #42446.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r51302 r52141  
    641641        unset( $post_data['tax_input']['post_format'] );
    642642
    643         $updated[] = wp_update_post( $post_data );
     643        $post_id = wp_update_post( $post_data );
     644        update_post_meta( $post_id, '_edit_last', get_current_user_id() );
     645        $updated[] = $post_id;
    644646
    645647        if ( isset( $post_data['sticky'] ) && current_user_can( $ptype->cap->edit_others_posts ) ) {
Note: See TracChangeset for help on using the changeset viewer.