new Setting(id, value [, options])
A Customizer Setting.
A setting is WordPress data (theme mod, option, menu, etc.) that the user can
draft changes to in the Customizer.
Parameters:
Name | Type | Argument | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
string | The setting ID. | ||||||||||||||||||||||
value |
* | The initial value of the setting. | ||||||||||||||||||||||
options |
object |
<optional> |
{} | Options.
Properties
|
- Since:
-
- 3.4.0
- Source:
- See:
-
- PHP class WP_Customize_Setting.
Extends
Members
-
defaults :object
-
Default params.
Type:
- object
- Since:
-
- 4.9.0
- Source:
Methods
-
bind(A)
-
Bind a function to be invoked whenever the value changes.
Parameters:
Name Type Argument Description A
function <repeatable>
function, or multiple functions, to add to the callback stack. - Inherited From:
- Source:
-
findControls()
-
Find controls associated with this setting.
- Since:
-
- 4.6.0
- Source:
Returns:
Controls associated with setting.- Type
- Array:.<wp.customize.Control:>
-
get()
-
Get the value.
- Inherited From:
- Source:
Returns:
- Type
- mixed
-
initialize(initial, options)
-
Parameters:
Name Type Description initial
mixed The initial value. options
object - Inherited From:
- Source:
-
preview()
-
Refresh the preview, respective of the setting's refresh policy. If the preview hasn't sent a keep-alive message and is likely disconnected by having navigated to a non-allowed URL, then the refresh transport will be forced when postMessage is the transport. Note that postMessage does not throw an error when the recipient window fails to match the origin window, so using try/catch around the previewer.send() call to then fallback to refresh will not work.
- Since:
-
- 3.4.0
- Source:
Returns:
- Type
- void
-
set(to)
-
Set the value and trigger all bound callbacks.
Parameters:
Name Type Description to
object New value. - Inherited From:
- Source:
-
unbind(A)
-
Unbind a previously bound function.
Parameters:
Name Type Argument Description A
function <repeatable>
function, or multiple functions, to remove from the callback stack. - Inherited From:
- Source: