[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

WordPress Customize Control classes

File Size: 810 lines (26 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 20 files
 wp-includes/customize/class-wp-customize-media-control.php
 wp-includes/customize/class-wp-sidebar-block-editor-control.php
 wp-includes/customize/class-wp-customize-upload-control.php
 wp-includes/customize/class-wp-customize-date-time-control.php
 wp-includes/customize/class-wp-customize-theme-control.php
 wp-includes/customize/class-wp-customize-nav-menu-item-control.php
 wp-includes/customize/class-wp-widget-area-customize-control.php
 wp-includes/customize/class-wp-customize-color-control.php
 wp-includes/customize/class-wp-customize-header-image-control.php
 wp-includes/customize/class-wp-customize-site-icon-control.php
 wp-includes/customize/class-wp-customize-image-control.php
 wp-includes/customize/class-wp-customize-background-position-control.php
 wp-includes/customize/class-wp-customize-background-image-control.php
 wp-includes/customize/class-wp-customize-nav-menu-name-control.php
 wp-includes/customize/class-wp-widget-form-customize-control.php
 wp-includes/customize/class-wp-customize-nav-menu-locations-control.php
 wp-includes/customize/class-wp-customize-nav-menu-location-control.php
 wp-includes/customize/class-wp-customize-cropped-image-control.php
 wp-includes/customize/class-wp-customize-nav-menu-auto-add-control.php
 wp-includes/customize/class-wp-customize-nav-menu-control.php

Defines 1 class

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    {

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


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

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.

return: true Always true.

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

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


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

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
false.

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.

return: string Contents of the control.

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


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


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

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

param: string $setting_key

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


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().


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.


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().




Generated : Wed Apr 24 08:20:01 2024 Cross-referenced by PHPXref