customize_value_{$id_base} WordPress Filter Hook

The customize_value_{$id_base} hook is used to filter the value of a setting before it is saved to the database. This hook is called by the Customizer when saving a setting, and is passed the new value, the WP_Customize_Setting object, and the Customizer instance.

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

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.


Top ↑

Parameters

$default_value

(mixed)The setting default value. Default empty.

$setting

(WP_Customize_Setting)The setting instance.


Top ↑

Source

File: wp-includes/class-wp-customize-setting.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.6.0Added the $this setting instance as the second parameter.
3.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.