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

Filters nonces for Customizer.

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

add_filter( 'customize_refresh_nonces', 'wp_kama_customize_refresh_nonces_filter', 10, 2 );

/**
 * Function for `customize_refresh_nonces` filter-hook.
 * 
 * @param string[]             $nonces  Array of refreshed nonces for save and preview actions.
 * @param WP_Customize_Manager $manager WP_Customize_Manager instance.
 *
 * @return string[]
 */
function wp_kama_customize_refresh_nonces_filter( $nonces, $manager ){

	// filter...
	return $nonces;
}
$nonces(string[])
Array of refreshed nonces for save and preview actions.
$manager(WP_Customize_Manager)
WP_Customize_Manager instance.

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

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

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

WP_Customize_Manager::get_nonces()
customize_refresh_nonces
wp-includes/class-wp-customize-manager.php 4775
$nonces = apply_filters( 'customize_refresh_nonces', $nonces, $this );

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

wp-includes/class-wp-customize-nav-menus.php 60
add_filter( 'customize_refresh_nonces', array( $this, 'filter_nonces' ) );
wp-includes/class-wp-customize-widgets.php 121
add_filter( 'customize_refresh_nonces', array( $this, 'refresh_nonces' ) );