[wp-trac] [WordPress Trac] #42446: Bulk edits don't update "last edited by..." which user

WordPress Trac noreply at wordpress.org
Tue Sep 21 16:39:08 UTC 2021


#42446: Bulk edits don't update "last edited by..." which user
-------------------------------------------------+-------------------------
 Reporter:  calebwoodbridge                      |       Owner:
                                                 |  guillaumeturpin
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Posts, Post Types                    |     Version:  4.9
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug 2nd-opinion has-      |     Focuses:
  patch                                          |  administration
-------------------------------------------------+-------------------------
Changes (by audrasjb):

 * keywords:  needs-patch good-first-bug => good-first-bug 2nd-opinion has-
     patch


Comment:

 Thanks for the quick patch @guillaumeturpin!

 {{{
 $post_id = wp_update_post( $post_data );
 if ( update_post_meta( $post_id, '_edit_last', get_current_user_id() ) ) {
     $updated[] = $post_id;
 }
 }}}

 Just wondering if we really need/want to place `$updated[] = $post_id;`
 within a conditional statement.

 Maybe the code below would be enough and more straightforward?
 {{{
 $updated[] = $post_id = wp_update_post( $post_data );
 update_post_meta( $post_id, '_edit_last', get_current_user_id() ) );
 }}}

 By the way, the patch works fine on my side.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/42446#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list