customize_post_value_set_(setting_id) хук-событиеWP 4.4.0

Announces when a specific setting's unsanitized post value has been set.

Fires when the WP_Customize_Manager::set_post_value() method is called.

The dynamic portion of the hook name, $setting_id, refers to the setting ID.

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

add_action( 'customize_post_value_set_(setting_id)', 'wp_kama_customize_post_value_set_setting_id_action', 10, 2 );

/**
 * Function for `customize_post_value_set_(setting_id)` action-hook.
 * 
 * @param mixed                $value   Unsanitized setting post value.
 * @param WP_Customize_Manager $manager WP_Customize_Manager instance.
 *
 * @return void
 */
function wp_kama_customize_post_value_set_setting_id_action( $value, $manager ){

	// action...
}
$value(разное)
Unsanitized setting post value.
$manager(WP_Customize_Manager)
WP_Customize_Manager instance.

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

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

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

WP_Customize_Manager::set_post_value()
customize_post_value_set_(setting_id)
wp-includes/class-wp-customize-manager.php 1877
do_action( "customize_post_value_set_{$setting_id}", $value, $this );

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

wp-includes/class-wp-customize-setting.php 259
add_action( "customize_post_value_set_{$this->id}", array( $this, '_clear_aggregated_multidimensional_preview_applied_flag' ), 9 );
wp-includes/class-wp-customize-setting.php 360
add_action( "customize_post_value_set_{$this->id}", array( $this, 'preview' ) );