Changeset 42139
- Timestamp:
- 11/09/2017 04:44:35 AM (7 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/src/wp-admin/customize.php
r41839 r42139 43 43 ); 44 44 if ( $missed_schedule ) { 45 wp_publish_post( $changeset_post->ID ); 45 /* 46 * Note that an Ajax request spawns here instead of just calling `wp_publish_post( $changeset_post->ID )`. 47 * 48 * Because WP_Customize_Manager is not instantiated for customize.php with the `settings_previewed=false` 49 * argument, settings cannot be reliably saved. Some logic short-circuits if the current value is the 50 * same as the value being saved. This is particularly true for options via `update_option()`. 51 * 52 * By opening an Ajax request, this is avoided and the changeset is published. See #39221. 53 */ 54 $nonces = $wp_customize->get_nonces(); 55 $request_args = array( 56 'nonce' => $nonces['save'], 57 'customize_changeset_uuid' => $wp_customize->changeset_uuid(), 58 'wp_customize' => 'on', 59 'customize_changeset_status' => 'publish', 60 ); 61 ob_start(); 62 ?> 63 <?php wp_print_scripts( array( 'wp-util' ) ); ?> 64 <script> 65 wp.ajax.post( 'customize_save', <?php echo wp_json_encode( $request_args ); ?> ); 66 </script> 67 <?php 68 $script = ob_get_clean(); 69 46 70 wp_die( 47 71 '<h1>' . __( 'Your scheduled changes just published' ) . '</h1>' . 48 '<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>' ,72 '<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>' . $script, 49 73 200 50 74 );
Note: See TracChangeset
for help on using the changeset viewer.