diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index 5ea7aff..d9d7e28 100644
|
|
|
|
| 1017 | 1017 | } |
| 1018 | 1018 | |
| 1019 | 1019 | // Check for cheaters. |
| 1020 | | if ( '-1' === response ) { |
| | 1020 | if ( '-1' === response || 'cheatin' === response.data ) { |
| 1021 | 1021 | self.cheatin(); |
| 1022 | 1022 | return; |
| 1023 | 1023 | } |
| 1024 | 1024 | |
| 1025 | | api.trigger( 'saved' ); |
| | 1025 | api.trigger( 'saved', response.data ); |
| 1026 | 1026 | } ); |
| 1027 | 1027 | }; |
| 1028 | 1028 | |
diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
index 5e2ba5d..c40933e 100644
|
|
|
final class WP_Customize_Manager {
|
| 596 | 596 | * @since 3.4.0 |
| 597 | 597 | */ |
| 598 | 598 | public function save() { |
| 599 | | if ( ! $this->is_preview() ) |
| 600 | | die; |
| | 599 | if ( ! $this->is_preview() ) { |
| | 600 | wp_send_json_error( 'not_preview' ); |
| | 601 | } |
| 601 | 602 | |
| 602 | | check_ajax_referer( 'save-customize_' . $this->get_stylesheet(), 'nonce' ); |
| | 603 | $action = 'save-customize_' . $this->get_stylesheet(); |
| | 604 | if ( ! check_ajax_referer( $action, 'nonce', false ) ) { |
| | 605 | wp_send_json_error( 'cheatin' ); |
| | 606 | } |
| 603 | 607 | |
| 604 | 608 | // Do we have to switch themes? |
| 605 | 609 | if ( ! $this->is_theme_active() ) { |
| … |
… |
final class WP_Customize_Manager {
|
| 634 | 638 | */ |
| 635 | 639 | do_action( 'customize_save_after', $this ); |
| 636 | 640 | |
| 637 | | die; |
| | 641 | /** |
| | 642 | * Filter response data for customize_save Ajax request. |
| | 643 | * |
| | 644 | * @since 4.1.0 |
| | 645 | * |
| | 646 | * @param array $data |
| | 647 | * @param WP_Customize_Manager $this WP_Customize_Manager instance. |
| | 648 | */ |
| | 649 | $response = apply_filters( 'wp_customize_save_response', array(), $this ); |
| | 650 | wp_send_json_success( $response ); |
| 638 | 651 | } |
| 639 | 652 | |
| 640 | 653 | /** |