diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index 4901b56..caf296a 100644
|
|
|
3375 | 3375 | api.bind( 'nonce-refresh', function( nonce ) { |
3376 | 3376 | $.extend( api.settings.nonce, nonce ); |
3377 | 3377 | $.extend( api.previewer.nonce, nonce ); |
| 3378 | api.previewer.send( 'nonce-refresh', nonce ); |
3378 | 3379 | }); |
3379 | 3380 | |
3380 | 3381 | // Create Settings |
diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
index aa73ed7..da3b222 100644
|
|
final class WP_Customize_Manager { |
801 | 801 | */ |
802 | 802 | public function customize_preview_settings() { |
803 | 803 | $settings = array( |
| 804 | 'theme' => array( |
| 805 | 'stylesheet' => $this->get_stylesheet(), |
| 806 | 'active' => $this->is_theme_active(), |
| 807 | ), |
804 | 808 | 'channel' => wp_unslash( $_POST['customize_messenger_channel'] ), |
805 | 809 | 'activePanels' => array(), |
806 | 810 | 'activeSections' => array(), |
… |
… |
final class WP_Customize_Manager { |
808 | 812 | '_dirty' => array_keys( $this->unsanitized_post_values() ), |
809 | 813 | ); |
810 | 814 | |
811 | | if ( 2 == $this->nonce_tick ) { |
812 | | $settings['nonce'] = array( |
813 | | 'save' => wp_create_nonce( 'save-customize_' . $this->get_stylesheet() ), |
814 | | 'preview' => wp_create_nonce( 'preview-customize_' . $this->get_stylesheet() ) |
815 | | ); |
816 | | } |
| 815 | $settings['nonce'] = array( |
| 816 | 'save' => wp_create_nonce( 'save-customize_' . $this->get_stylesheet() ), |
| 817 | 'preview' => wp_create_nonce( 'preview-customize_' . $this->get_stylesheet() ), |
| 818 | ); |
| 819 | |
| 820 | /** This filter is documented in wp-includes/class-wp-customize-manager.php */ |
| 821 | $settings['nonce'] = apply_filters( 'customize_refresh_nonces', $settings['nonce'], $this ); |
817 | 822 | |
818 | 823 | foreach ( $this->panels as $panel_id => $panel ) { |
819 | 824 | if ( $panel->check_capabilities() ) { |
… |
… |
final class WP_Customize_Manager { |
1703 | 1708 | 'documentTitleTmpl' => $this->get_document_title_template(), |
1704 | 1709 | ); |
1705 | 1710 | |
| 1711 | /** This filter is documented in wp-includes/class-wp-customize-manager.php */ |
| 1712 | $settings['nonce'] = apply_filters( 'customize_refresh_nonces', $settings['nonce'], $this ); |
| 1713 | |
1706 | 1714 | // Prepare Customize Section objects to pass to JavaScript. |
1707 | 1715 | foreach ( $this->sections() as $id => $section ) { |
1708 | 1716 | if ( $section->check_capabilities() ) { |
diff --git src/wp-includes/class-wp-customize-nav-menus.php src/wp-includes/class-wp-customize-nav-menus.php
index 2c90548..c3501ba 100644
|
|
final class WP_Customize_Nav_Menus { |
940 | 940 | 'renderNonceValue' => wp_create_nonce( self::RENDER_AJAX_ACTION ), |
941 | 941 | 'renderNoncePostKey' => self::RENDER_NONCE_POST_KEY, |
942 | 942 | 'requestUri' => empty( $_SERVER['REQUEST_URI'] ) ? home_url( '/' ) : esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ), |
943 | | 'theme' => array( |
944 | | 'stylesheet' => $this->manager->get_stylesheet(), |
945 | | 'active' => $this->manager->is_theme_active(), |
946 | | ), |
947 | | 'previewCustomizeNonce' => wp_create_nonce( 'preview-customize_' . $this->manager->get_stylesheet() ), |
948 | 943 | 'navMenuInstanceArgs' => $this->preview_nav_menu_instance_args, |
949 | 944 | 'l10n' => array( |
950 | 945 | 'editNavMenuItemTooltip' => __( 'Shift-click to edit this menu item.' ), |
diff --git src/wp-includes/js/customize-preview-nav-menus.js src/wp-includes/js/customize-preview-nav-menus.js
index fe5f305..b869046 100644
|
|
|
13 | 13 | renderQueryVar: null, |
14 | 14 | renderNonceValue: null, |
15 | 15 | renderNoncePostKey: null, |
16 | | previewCustomizeNonce: null, |
17 | 16 | requestUri: '/', |
18 | | theme: { |
19 | | active: false, |
20 | | stylesheet: '' |
21 | | }, |
22 | 17 | navMenuInstanceArgs: {}, |
23 | 18 | l10n: {} |
24 | 19 | }; |
… |
… |
|
200 | 195 | menuId = parseInt( menuId, 10 ); |
201 | 196 | |
202 | 197 | data = { |
203 | | nonce: settings.previewCustomizeNonce, // for Customize Preview |
| 198 | nonce: wp.customize.settings.nonce.preview, |
204 | 199 | wp_customize: 'on' |
205 | 200 | }; |
206 | | if ( ! settings.theme.active ) { |
207 | | data.theme = settings.theme.stylesheet; |
| 201 | if ( ! wp.customize.settings.theme.active ) { |
| 202 | data.theme = wp.customize.settings.theme.stylesheet; |
208 | 203 | } |
209 | 204 | data[ settings.renderQueryVar ] = '1'; |
210 | 205 | |
diff --git src/wp-includes/js/customize-preview.js src/wp-includes/js/customize-preview.js
index 1d18027..b6da775 100644
|
|
|
146 | 146 | }); |
147 | 147 | |
148 | 148 | api.preview.bind( 'active', function() { |
149 | | if ( api.settings.nonce ) { |
150 | | api.preview.send( 'nonce', api.settings.nonce ); |
151 | | } |
| 149 | api.preview.send( 'nonce', api.settings.nonce ); |
152 | 150 | |
153 | 151 | api.preview.send( 'documentTitle', document.title ); |
154 | 152 | }); |
… |
… |
|
163 | 161 | } ); |
164 | 162 | } ); |
165 | 163 | |
| 164 | api.preview.bind( 'nonce-refresh', function( nonce ) { |
| 165 | $.extend( api.settings.nonce, nonce ); |
| 166 | } ); |
| 167 | |
166 | 168 | /* |
167 | 169 | * Send a message to the parent customize frame with a list of which |
168 | 170 | * containers and controls are active. |