customize_post_value_set_<setting_id>

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

Description

do_action( 'customize_post_value_set_<setting_id>', (mixed) $value, (WP_Customize_Manager) $instance ); 

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

The dynamic portion(s) of the hook name refer to the setting ID.

Parameters (2)

0. $value (mixed)
Unsanitized setting post value.
1. $instance (WP_Customize_Manager)
WP_Customize_Manager instance.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'customize_post_value_set_{$setting_id}', $value, $instance ); 
The following example is for adding a hook callback.
  1. // define the customize_post_value_set_<setting_id> callback 
  2. function action_customize_post_value_set_setting_id( $value, $instance ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( "customize_post_value_set_{$setting_id}", 'action_customize_post_value_set_setting_id', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( "customize_post_value_set_{$setting_id}", 'action_customize_post_value_set_setting_id', 10, 2 ); 

Defined (1)

The action is defined in the following location(s).

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