- Timestamp:
- 09/23/2019 05:39:36 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r46249 r46252 1022 1022 // Post date. 1023 1023 if ( ! empty( $schema['properties']['date'] ) && ! empty( $request['date'] ) ) { 1024 $date_data = rest_get_date_with_gmt( $request['date'] ); 1025 1026 if ( ! empty( $date_data ) ) { 1024 $current_date = isset( $prepared_post->ID ) ? get_post( $prepared_post->ID )->post_date : false; 1025 $date_data = rest_get_date_with_gmt( $request['date'] ); 1026 1027 if ( ! empty( $date_data ) && $current_date !== $date_data[0] ) { 1027 1028 list( $prepared_post->post_date, $prepared_post->post_date_gmt ) = $date_data; 1028 1029 $prepared_post->edit_date = true; 1029 1030 } 1030 1031 } elseif ( ! empty( $schema['properties']['date_gmt'] ) && ! empty( $request['date_gmt'] ) ) { 1031 $date_data = rest_get_date_with_gmt( $request['date_gmt'], true ); 1032 1033 if ( ! empty( $date_data ) ) { 1032 $current_date = isset( $prepared_post->ID ) ? get_post( $prepared_post->ID )->post_date_gmt : false; 1033 $date_data = rest_get_date_with_gmt( $request['date_gmt'], true ); 1034 1035 if ( ! empty( $date_data ) && $current_date !== $date_data[1] ) { 1034 1036 list( $prepared_post->post_date, $prepared_post->post_date_gmt ) = $date_data; 1035 1037 $prepared_post->edit_date = true;
Note: See TracChangeset
for help on using the changeset viewer.