customize_post_value_set

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

Description

do_action( 'customize_post_value_set', (string) $setting_id, (mixed) $value, (WP_Customize_Manager) $instance ); 

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

This is useful for WP_Customize_Setting instances to watch in order to update a cached previewed value.

Parameters (3)

0. $setting_id (string)
The setting id.
1. $value (mixed)
Unsanitized setting post value.
2. $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 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', 'action_customize_post_value_set', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'customize_post_value_set', 'action_customize_post_value_set', 10, 3 ); 

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 );