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.
- // run the action
- do_action( 'customize_post_value_set', $setting_id, $value, $instance );
- The following example is for adding a hook callback.
- // define the customize_post_value_set callback
- function action_customize_post_value_set( $setting_id, $value, $instance ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'customize_post_value_set', 'action_customize_post_value_set', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the action
- 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
- do_action( 'customize_post_value_set', $setting_id, $value, $this );