- Timestamp:
- 09/23/2019 05:24:58 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r46184 r46249 1037 1037 } 1038 1038 1039 // Sending a null date or date_gmt value resets date and date_gmt to their 1040 // default values (`0000-00-00 00:00:00`). 1041 if ( 1042 ( ! empty( $schema['properties']['date_gmt'] ) && $request->has_param( 'date_gmt' ) && null === $request['date_gmt'] ) || 1043 ( ! empty( $schema['properties']['date'] ) && $request->has_param( 'date' ) && null === $request['date'] ) 1044 ) { 1045 $prepared_post->post_date_gmt = null; 1046 $prepared_post->post_date = null; 1047 } 1048 1039 1049 // Post slug. 1040 1050 if ( ! empty( $schema['properties']['slug'] ) && isset( $request['slug'] ) ) { … … 1892 1902 'date' => array( 1893 1903 'description' => __( "The date the object was published, in the site's timezone." ), 1894 'type' => 'string',1904 'type' => array( 'string', 'null' ), 1895 1905 'format' => 'date-time', 1896 1906 'context' => array( 'view', 'edit', 'embed' ), … … 1898 1908 'date_gmt' => array( 1899 1909 'description' => __( 'The date the object was published, as GMT.' ), 1900 'type' => 'string',1910 'type' => array( 'string', 'null' ), 1901 1911 'format' => 'date-time', 1902 1912 'context' => array( 'view', 'edit' ),
Note: See TracChangeset
for help on using the changeset viewer.