customize_post_value_set_<setting_id>
Announce when a specific setting's unsanitized post value has been set.
Description
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.
- // 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_<setting_id> 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_{$setting_id}", 'action_customize_post_value_set_setting_id', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the action
- 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
- do_action( "customize_post_value_set_{$setting_id}", $value, $this );