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. Built from https://develop.svn.wordpress.org/trunk@52141 git-svn-id: http://core.svn.wordpress.org/trunk@51733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
841e45a864
commit
00403bc675
|
@ -640,7 +640,9 @@ function bulk_edit_posts( $post_data = null ) {
|
|||
// Prevent wp_insert_post() from overwriting post format with the old data.
|
||||
unset( $post_data['tax_input']['post_format'] );
|
||||
|
||||
$updated[] = wp_update_post( $post_data );
|
||||
$post_id = wp_update_post( $post_data );
|
||||
update_post_meta( $post_id, '_edit_last', get_current_user_id() );
|
||||
$updated[] = $post_id;
|
||||
|
||||
if ( isset( $post_data['sticky'] ) && current_user_can( $ptype->cap->edit_others_posts ) ) {
|
||||
if ( 'sticky' === $post_data['sticky'] ) {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-alpha-52140';
|
||||
$wp_version = '5.9-alpha-52141';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue