wppaste
WordPress

WP_Customize_Setting

Since
3.4.0
Source
wp-includes/class-wp-customize-setting.php:25
Customize Setting class.

Description

Handles saving and sanitizing of settings.

Compatibility

WordPress
since 3.4.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).

Hooks and filters fired · 8

Every hook that fires from inside WP_Customize_Setting, in the order it appears in the class, grouped by the method that fires it.

Properties · 17

$managerWP_Customize_Managerpublic
Customizer bootstrap instance.
$idstringpublic
Unique string identifier for the setting.
$typestringpublic
Type of customize settings.
$capabilitystring|arraypublic
Capability required to edit this setting.
$theme_supportsstring|string[]public
Theme features required to support the setting.
$defaultstringpublic
The default value for the setting.
$transportstringpublic
Options for rendering the live preview of changes in Customizer.
$validate_callbackcallablepublic
Server-side validation callback for the setting's value.
$sanitize_callbackcallablepublic
Callback to filter a Customize setting value in un-slashed form.
$sanitize_js_callbackcallablepublic
Callback to convert a Customize PHP setting value to a value that is JSON serializable.
$dirtyboolpublic
Whether or not the setting is initially dirty when created.
$id_dataarrayprotected
ID Data.
$is_previewedboolprotected
Whether or not preview() was called.
$aggregated_multidimensionalsarrayprotected static
Cache of multidimensional values to improve performance.
$is_multidimensional_aggregatedboolprotected
Whether the multidimensional setting is aggregated.
$_previewed_blog_idintprotected
The ID for the current site when the preview() method was called.
$_original_valuemixedprotected
Original non-previewed value stored by the preview method.

Methods · 26

Source code

#[AllowDynamicProperties]class WP_Customize_Setting {	/**	 * Customizer bootstrap instance.	 *	 * @since 3.4.0	 * @var WP_Customize_Manager	 */	public $manager; 	/**	 * Unique string identifier for the setting.	 *	 * @since 3.4.0	 * @var string	 */	public $id; 	/**	 * Type of customize settings.	 *	 * @since 3.4.0	 * @var string	 */	public $type = 'theme_mod'; 	/**	 * Capability required to edit this setting.	 *	 * @since 3.4.0	 * @var string|array	 */	public $capability = 'edit_theme_options'; 	/**	 * Theme features required to support the setting.	 *	 * @since 3.4.0	 * @var string|string[]	 */	public $theme_supports = ''; 	/**	 * The default value for the setting.	 *	 * @since 3.4.0	 * @var string	 */	public $default = ''; 	/**	 * Options for rendering the live preview of changes in Customizer.	 *	 * Set this value to 'postMessage' to enable a custom JavaScript handler to render changes to this setting	 * as opposed to reloading the whole page.	 *	 * @since 3.4.0	 * @var string	 */	public $transport = 'refresh'; 	/**	 * Server-side validation callback for the setting's value.	 *	 * @since 4.6.0	 * @var callable	 */	public $validate_callback = ''; 	/**	 * Callback to filter a Customize setting value in un-slashed form.	 *	 * @since 3.4.0	 * @var callable	 */	public $sanitize_callback = ''; 	/**	 * Callback to convert a Customize PHP setting value to a value that is JSON serializable.	 *

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.

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, from src/wp-includes/class-wp-customize-setting.php, 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.