WordPress.org

Make WordPress Core

Ticket #18362: post_status.18362.1.patch

File post_status.18362.1.patch, 596 bytes (added by danielbachhuber, 10 years ago)

Whitelist post statuses that should receive post_date_gmt instead of blacklisting. Whitelist based on WordPress builtin statuses

  • wp-includes/post.php

     
    25042504                $post_date = current_time('mysql');
    25052505
    25062506        if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) {
    2507                 if ( !in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) )
     2507                if ( in_array( $post_status, array( 'future', 'publish', 'trash', 'private', 'inherit' ) ) )
    25082508                        $post_date_gmt = get_gmt_from_date($post_date);
    25092509                else
    25102510                        $post_date_gmt = '0000-00-00 00:00:00';