[wp-trac] [WordPress Trac] #31635: Bulk Edit -> Publish should publish scheduled posts

WordPress Trac noreply at wordpress.org
Sun Mar 19 09:00:52 UTC 2023


#31635: Bulk Edit -> Publish should publish scheduled posts
----------------------------------------------------+---------------------
 Reporter:  siobhan                                 |       Owner:  (none)
     Type:  defect (bug)                            |      Status:  new
 Priority:  normal                                  |   Milestone:
Component:  Quick/Bulk Edit                         |     Version:
 Severity:  normal                                  |  Resolution:
 Keywords:  has-patch has-unit-tests needs-testing  |     Focuses:  ui
----------------------------------------------------+---------------------

Comment (by cadic):

 @oglekler yes, it looks out of scope to assign current time as post_date
 of posts being published from drafts during bulk edit.

 It may be an easy adjustment within the current change (and will also
 worth adding another unit test case)


 {{{
 diff --git a/src/wp-admin/includes/post.php b/src/wp-
 admin/includes/post.php
 index 0c9f9250ed..bdb07604a4 100644
 --- a/src/wp-admin/includes/post.php
 +++ b/src/wp-admin/includes/post.php
 @@ -665,7 +665,7 @@ function bulk_edit_posts( $post_data = null ) {
                 unset( $post_data['tax_input']['post_format'] );

                 // Reset post date of scheduled post to be published.
 -               if ( 'future' === $post->post_status && 'publish' ===
 $post_data['post_status'] ) {
 +               if ( in_array( $post->post_status, array( 'future',
 'draft' ), true ) && 'publish' === $post_data['post_status'] ) {
                         $post_data['post_date']     = current_time(
 'mysql' );
                         $post_data['post_date_gmt'] = '';
                 }
 }}}

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


More information about the wp-trac mailing list