[ Index ] |
PHP Cross Reference of WordPress |
[Source view] [Print] [Project Stats]
WordPress Customize Control classes
WP_Customize_Control:: (17 methods):
__construct()
enqueue()
active()
active_callback()
value()
to_json()
json()
check_capabilities()
get_content()
maybe_render()
render()
get_link()
link()
input_attrs()
render_content()
print_template()
content_template()
Class: WP_Customize_Control - X-Ref
Customize Control class.__construct( $manager, $id, $args = array() X-Ref |
Constructor. 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. return: bool Whether the control is active to the current preview. since: 4.0.0 |
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. return: true Always true. since: 4.0.0 |
value( $setting_key = 'default' ) X-Ref |
Fetch a setting's value. Grabs the main setting by default. return: mixed The requested setting's value, if the setting exists. param: string $setting_key since: 3.4.0 |
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. return: array Array of parameters passed to the JavaScript. since: 4.1.0 |
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 false. return: bool False if theme doesn't support the control or user doesn't have the required permissions, otherwise true. since: 3.4.0 |
get_content() X-Ref |
Get the control's content for insertion into the Customizer pane. return: string Contents of the control. since: 4.1.0 |
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. return: string Data link parameter, a `data-customize-setting-link` attribute if the `$setting_key` refers to a pre-registered 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. |
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 WP_Customize_Manager::register_control_type(). 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: Thu Nov 21 01:00:03 2024 | Cross-referenced by PHPXref 0.7.1 |