customize_save_response
Filters response data for a successful customize_save Ajax request.
Description
This filter does not apply if there was a nonce or authentication failure.
Parameters (2)
- 0. $response (array)
- Additional information passed back to the saved event on
wp
.customize.. - 1. $instance (WP_Customize_Manager)
-
WP_Customize_Manager
instance.
Usage
- To run the hook, copy the example below.
- $response = apply_filters( 'customize_save_response', $response, $instance );
- if ( !empty( $response ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the customize_save_response callback
- function filter_customize_save_response( $response, $instance ) {
- // make filter magic happen here...
- return $response;
- };
- // add the filter
- add_filter( 'customize_save_response', 'filter_customize_save_response', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'customize_save_response', 'filter_customize_save_response', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/class-wp-customize-manager.php
- $response = apply_filters( 'customize_save_response', $response, $this );