Changeset 40324
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r40306 r40324 1402 1402 // field with the site's timezone offset applied. 1403 1403 if ( '0000-00-00 00:00:00' === $post->post_date_gmt ) { 1404 $post_date_gmt = date( 'Y-m-d H:i:s', strtotime( $post->post_date ) - ( get_option( 'gmt_offset' ) * 3600 ));1404 $post_date_gmt = get_gmt_from_date( $post->post_date ); 1405 1405 } else { 1406 1406 $post_date_gmt = $post->post_date_gmt; -
trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php
r40284 r40324 2243 2243 2244 2244 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' ); 2247 2246 2248 2247 // Need to set dates using wpdb directly because `wp_update_post` and … … 2289 2288 2290 2289 update_option( 'timezone_string', '' ); 2291 update_option( 'gmt_offset', 0 );2292 2290 } 2293 2291
Note: See TracChangeset
for help on using the changeset viewer.