Changeset 56802
- Timestamp:
- 10/08/2023 08:08:08 PM (10 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/inline-edit-post.js
r56712 r56802 492 492 493 493 fields = $('#edit-'+id).find(':input').serialize(); 494 495 var status = $(':input[name="_status"]').val();496 497 if ( [ 'draft', 'pending', 'auto-draft' ].includes( status ) ) {498 params.edit_date = 'false';499 }500 501 494 params = fields + '&' + $.param(params); 502 495 -
trunk/src/wp-admin/includes/post.php
r56752 r56802 170 170 break; 171 171 } 172 }173 174 if ( isset( $post_data['edit_date'] ) && 'false' === $post_data['edit_date'] ) {175 $post_data['edit_date'] = false;176 172 } 177 173 … … 198 194 } 199 195 200 $post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] ); 196 /* 197 * Only assign a post date if the user has explicitly set a new value. 198 * See #59125 and #19907. 199 */ 200 $previous_date = $post_id ? get_post_field( 'post_date', $post_id ) : false; 201 if ( $previous_date && $previous_date !== $post_data['post_date'] ) { 202 $post_data['edit_date'] = true; 203 $post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] ); 204 } else { 205 $post_data['edit_date'] = false; 206 unset( $post_data['post_date'] ); 207 unset( $post_data['post_date_gmt'] ); 208 } 201 209 } 202 210 -
trunk/tests/phpunit/tests/ajax/wpAjaxInlineSave.php
r56022 r56802 90 90 91 91 /** 92 * When updating a draft in quick edit mode, it should not set the publish date of the post when this one will be published.92 * When updating a draft in quick edit mode, it should not set the publish date of the post ed. 93 93 * 94 94 * @ticket 19907 … … 125 125 $_POST['post_view'] = 'list'; 126 126 $_POST['edit_date'] = 'false'; 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 127 184 $_POST['mm'] = '09'; 128 185 $_POST['jj'] = 11; … … 141 198 $post = get_post( $post->ID ); 142 199 143 $this->assertEquals( ' 0000-00-00 00:00:00', $post->post_date_gmt );200 $this->assertEquals( '', $post->post_date_gmt ); 144 201 } 145 202 }
Note: See TracChangeset
for help on using the changeset viewer.