customize_save_response хук-фильтрWP 4.2.0

Filters response data for a successful customize_save Ajax request.

This filter does not apply if there was a nonce or authentication failure.

Использование

add_filter( 'customize_save_response', 'wp_kama_customize_save_response_filter', 10, 2 );

/**
 * Function for `customize_save_response` filter-hook.
 * 
 * @param array                $response Additional information passed back to the 'saved' event on `wp.customize`.
 * @param WP_Customize_Manager $manager  WP_Customize_Manager instance.
 *
 * @return array
 */
function wp_kama_customize_save_response_filter( $response, $manager ){

	// filter...
	return $response;
}
$response(массив)
Additional information passed back to the 'saved' event on wp.customize.
$manager(WP_Customize_Manager)
WP_Customize_Manager instance.

Список изменений

С версии 4.2.0 Введена.

Где вызывается хук

WP_Customize_Manager::save()
customize_save_response
wp-includes/class-wp-customize-manager.php 2601
$response = apply_filters( 'customize_save_response', $response, $this );

Где используется хук в WordPress

wp-includes/customize/class-wp-customize-nav-menu-item-setting.php 774
add_filter( 'customize_save_response', array( $this, 'amend_customize_save_response' ) );
wp-includes/customize/class-wp-customize-nav-menu-setting.php 492
add_filter( 'customize_save_response', array( $this, 'amend_customize_save_response' ) );