Make WordPress Core


Ignore:
Timestamp:
03/24/2017 05:31:54 PM (7 years ago)
Author:
swissspidy
Message:

REST API: Use get_gmt_from_date() when preparing a draft post for response.

This prevents wrong dates when dealing with DST, see [40115] and [40284].

Props nerrad.
Fixes #40136.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php

    r40284 r40324  
    22432243
    22442244        wp_set_current_user( self::$editor_id );
    2245         update_option( 'timezone_string', '' );
    2246         update_option( 'gmt_offset', -6 );
     2245        update_option( 'timezone_string', 'America/Chicago' );
    22472246
    22482247        // Need to set dates using wpdb directly because `wp_update_post` and
     
    22892288
    22902289        update_option( 'timezone_string', '' );
    2291         update_option( 'gmt_offset', 0 );
    22922290    }
    22932291
Note: See TracChangeset for help on using the changeset viewer.