customize_post_value_set
Action HookDescription
Announces when any setting's unsanitized post value has been set. 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.Hook Information
File Location |
wp-includes/class-wp-customize-manager.php
View on GitHub
|
Hook Type | Action |
Line Number | 1898 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$setting_id
|
Setting ID. |
mixed
|
$value
|
Unsanitized setting post value. |
WP_Customize_Manager
|
$manager
|
WP_Customize_Manager instance. |
Usage Examples
Basic Usage
<?php
// Hook into customize_post_value_set
add_action('customize_post_value_set', 'my_custom_function', 10, 3);
function my_custom_function($setting_id, $value, $manager) {
// Your custom code here
}
Source Code Context
wp-includes/class-wp-customize-manager.php:1898
- How this hook is used in WordPress core
<?php
1893 *
1894 * @param string $setting_id Setting ID.
1895 * @param mixed $value Unsanitized setting post value.
1896 * @param WP_Customize_Manager $manager WP_Customize_Manager instance.
1897 */
1898 do_action( 'customize_post_value_set', $setting_id, $value, $this );
1899 }
1900
1901 /**
1902 * Prints JavaScript settings.
1903 *
PHP Documentation
<?php
/**
* Announces when any setting's unsanitized post value has been set.
*
* 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.
*
* @since 4.4.0
*
* @param string $setting_id Setting ID.
* @param mixed $value Unsanitized setting post value.
* @param WP_Customize_Manager $manager WP_Customize_Manager instance.
*/
Quick Info
- Hook Type: Action
- Parameters: 3
- File: wp-includes/class-wp-customize-manager.php
Related Hooks
Related hooks will be displayed here in future updates.