customize_value_(id_base)
Filters a Customize setting value not handled as a theme_mod or option.
The dynamic portion of the hook name, $id_base, refers to the base slug of the setting name, initialized from $this->id_data['base'].
For settings handled as theme_mods or options, see those corresponding functions for available hooks.
Usage
add_filter( 'customize_value_(id_base)', 'wp_kama_customize_value_id_base_filter', 10, 2 ); /** * Function for `customize_value_(id_base)` filter-hook. * * @param mixed $default_value The setting default value. * @param WP_Customize_Setting $setting The setting instance. * * @return mixed */ function wp_kama_customize_value_id_base_filter( $default_value, $setting ){ // filter... return $default_value; }
- $default_value(mixed)
- The setting default value.
Default: '' - $setting(WP_Customize_Setting)
- The setting instance.
Changelog
Since 3.4.0 | Introduced. |
Since 4.6.0 | Added the $this setting instance as the second parameter. |
Where the hook is called
customize_value_(id_base)
customize_value_(id_base)
wp-includes/class-wp-customize-setting.php 768
$value = apply_filters( "customize_value_{$id_base}", $value, $this );
wp-includes/customize/class-wp-customize-custom-css-setting.php 142
$value = apply_filters( "customize_value_{$id_base}", $value, $this );
Where the hook is used in WordPress
wp-includes/class-wp-customize-widgets.php 276
add_filter( 'customize_value_old_sidebars_widgets_data', array( $this, 'filter_customize_value_old_sidebars_widgets_data' ) );