wppaste
WordPress

apply_filters( "customize_value_{$id_base}", mixed $default_value, WP_Customize_Setting $setting )

Since
3.4.0, 4.6.0
Filters a Customize setting value not handled as a theme_mod or option.

Description

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.

Compatibility

WordPress
since 4.6.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$default_valuemixed
The setting default value. Default empty.
$settingWP_Customize_Setting
The setting instance.

Where this hook fires · 2

  • wp-includes/class-wp-customize-setting.php:768WP_Customize_Setting::value()
  • wp-includes/customize/class-wp-customize-custom-css-setting.php:142WP_Customize_Custom_CSS_Setting::value()

Source code

			 * @since 3.4.0			 * @since 4.6.0 Added the `$this` setting instance as the second parameter.			 *			 * @param mixed                $default_value The setting default value. Default empty.			 * @param WP_Customize_Setting $setting       The setting instance.			 */			$value = apply_filters( "customize_value_{$id_base}", $value, $this );		} elseif ( $this->is_multidimensional_aggregated ) {			$root_value = self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['root_value'];			$value      = $this->multidimensional_get( $root_value, $this->id_data['keys'], $this->default ); 			// Ensure that the post value is used if the setting is previewed, since preview filters aren't applying on cached $root_value.			if ( $this->is_previewed ) {

Changelog

Introduced in 3.4.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

4.6.0
Added the $this setting instance as the second parameter.from the docblock
3.4.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.7.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.