Make WordPress Core

Ticket #48006: 48006.diff

File 48006.diff, 1.1 KB (added by donmhico, 6 years ago)
  • src/wp-includes/post.php

    diff --git src/wp-includes/post.php src/wp-includes/post.php
    index 15422a5f32..c555b4b905 100644
    function wp_insert_post( $postarr, $wp_error = false ) { 
    37333733                                $post_status = 'future';
    37343734                        }
    37353735                } elseif ( 'future' === $post_status ) {
     3736                        /*
     3737                         * Both `post_date` and `post_date_gmt` should be set at the top of the set hour with the second being ':00' for scheduled
     3738                         * 'future' post.
     3739                         */
     3740                        $post_date_gmt_time = strtotime( $post_date_gmt );
     3741                        $post_date_time         = strtotime( $post_date );
     3742                       
     3743                        if ( $post_date_gmt_time && $post_date_time ) {
     3744                                $post_date_gmt_date = date( 'Y-m-d H:i:00', $post_date_gmt_time );
     3745                                $post_date_date     = date( 'Y-m-d H:i:00', $post_date_time );
     3746
     3747                                if ( $post_date_gmt_date && $post_date_date ) {
     3748                                        $post_date                                = $post_date_date;
     3749                                        $post_date_gmt                    = $post_date_gmt_date;
     3750                                        $postarr['post_date']     = $post_date;
     3751                                        $postarr['post_date_gmt'] = $post_modified_gmt;
     3752                                }
     3753                        }
     3754
    37363755                        if ( $post_date_gmt <= gmdate( 'Y-m-d H:i:59' ) ) {
    37373756                                $post_status = 'publish';
    37383757                        }