Ticket #41336: 41336.2.diff
File 41336.2.diff, 1.4 KB (added by , 7 years ago) |
---|
-
src/wp-includes/class-wp-customize-manager.php
2297 2297 } 2298 2298 } 2299 2299 2300 if ( ! empty( $is_future_dated ) && 'publish' === $args['status'] ) { 2301 $args['status'] = 'future'; 2302 } 2303 2300 2304 // The request was made via wp.customize.previewer.save(). 2301 2305 $update_transactionally = (bool) $args['status']; 2302 2306 $allow_revision = (bool) $args['status']; -
tests/phpunit/tests/customize/manager.php
1291 1291 $this->assertEquals( 'Unfiltered<script>evil</script>', get_option( 'scratchpad' ) ); 1292 1292 } 1293 1293 1294 function test_publish_changeset_with_future_status_when_future_date() { 1295 $wp_customize = $this->create_test_manager( wp_generate_uuid4() ); 1296 1297 $wp_customize->save_changeset_post( array( 1298 'date_gmt' => gmdate( 'Y-m-d H:i:s', strtotime( '+1 day' ) ), 1299 'status' => 'publish', 1300 'title' => 'Foo', 1301 ) ); 1302 1303 $this->assertSame( 'future', get_post_status( $wp_customize->changeset_post_id() ) ); 1304 } 1305 1294 1306 /** 1295 1307 * Ensure that save_changeset_post method bails updating an underlying changeset which is invalid. 1296 1308 *