[ Index ]

PHP Cross Reference of WordPress




/wp-includes/ -> class-wp-customize-control.php (summary)

WordPress Customize Control classes

File Size: 797 lines (26 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 19 files

Defines 1 class

WP_Customize_Control:: (17 methods):

Class: WP_Customize_Control  - X-Ref

Customize Control class.

__construct( $manager, $id, $args = array()   X-Ref

Supplied `$args` override class property defaults.

If `$args['settings']` is not defined, use the $id as the setting ID.

param: WP_Customize_Manager $manager Customizer bootstrap instance.
param: string               $id      Control ID.
param: array                $args    {
since: 3.4.0

enqueue()   X-Ref
Enqueue control related scripts/styles.

since: 3.4.0

active()   X-Ref
Check whether control is active to current Customizer preview.

since: 4.0.0
return: bool Whether the control is active to the current preview.

active_callback()   X-Ref
Default callback used when invoking WP_Customize_Control::active().

Subclasses can override this with their specific logic, or they may
provide an 'active_callback' argument to the constructor.

since: 4.0.0
return: true Always true.

value( $setting_key = 'default' )   X-Ref
Fetch a setting's value.
Grabs the main setting by default.

param: string $setting_key
since: 3.4.0
return: mixed The requested setting's value, if the setting exists.

to_json()   X-Ref
Refresh the parameters passed to the JavaScript via JSON.

since: 3.4.0

json()   X-Ref
Get the data to export to the client via JSON.

since: 4.1.0
return: array Array of parameters passed to the JavaScript.

check_capabilities()   X-Ref
Checks if the user can use this control.

Returns false if the user cannot manipulate one of the associated settings,
or if one of the associated settings does not exist. Also returns false if
the associated section does not exist or if its capability check returns

since: 3.4.0
return: bool False if theme doesn't support the control or user doesn't have the required permissions, otherwise true.

get_content()   X-Ref
Get the control's content for insertion into the Customizer pane.

since: 4.1.0
return: string Contents of the control.

maybe_render()   X-Ref
Check capabilities and render the control.

since: 3.4.0

render()   X-Ref
Renders the control wrapper and calls $this->render_content() for the internals.

since: 3.4.0

get_link( $setting_key = 'default' )   X-Ref
Get the data link attribute for a setting.

param: string $setting_key
since: 3.4.0
since: 4.9.0 Return a `data-customize-setting-key-link` attribute if a setting is not registered for the supplied setting key.
return: string Data link parameter, a `data-customize-setting-link` attribute if the `$setting_key` refers to a pre-registered setting,

link( $setting_key = 'default' )   X-Ref
Render the data link attribute for the control's input element.

param: string $setting_key
since: 3.4.0

input_attrs()   X-Ref
Render the custom attributes for the control's input element.

since: 4.0.0

render_content()   X-Ref
Render the control's content.

Allows the content to be overridden without having to rewrite the wrapper in `$this::render()`.

Supports basic input types `text`, `checkbox`, `textarea`, `radio`, `select` and `dropdown-pages`.
Additional input types such as `email`, `url`, `number`, `hidden` and `date` are supported implicitly.

Control content can alternately be rendered in JS. See WP_Customize_Control::print_template().

since: 3.4.0

print_template()   X-Ref
Render the control's JS template.

This function is only run for control types that have been registered with

In the future, this will also print the template for the control's container
element and be override-able.

since: 4.1.0

content_template()   X-Ref
An Underscore (JS) template for this control's content (but not its container).

Class variables for this control class are available in the `data` JS object;
export custom variables by overriding WP_Customize_Control::to_json().

since: 4.1.0

Generated: Sat May 15 01:00:05 2021 Cross-referenced by PHPXref 0.7.1