PHP 클래스 WP_Customize_Control, wordpress

파일 보기 프로젝트 열기: johnpbloch/wordpress 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$active_callback Callback.
$allow_addition boolean Show UI for adding new content, currently only used for the dropdown-pages control.
$capability string Normally this is empty and the capability is derived from the capabilities of the associated $settings.
$choices array
$description string
$id string
$input_attrs array
$instance_number integer Order in which this instance was created in relation to other instances.
$json array
$label string
$manager WP_Customize_Manager
$priority integer
$section string
$setting string The primary setting for the control (if there is one).
$settings array All settings tied to the control.
$type string

보호된 프로퍼티들

프로퍼티 타입 설명
$instance_count integer Used when sorting two instances whose priorities are equal.

공개 메소드들

메소드 설명
__construct ( WP_Customize_Manager $manager, string $id, array $args = [] ) Constructor.
active ( ) : boolean Check whether control is active to current Customizer preview.
active_callback ( ) : true Default callback used when invoking WP_Customize_Control::active().
check_capabilities ( ) : boolean Checks if the user can use this control.
enqueue ( ) Enqueue control related scripts/styles.
get_content ( ) : string Get the control's content for insertion into the Customizer pane.
get_link ( string $setting_key = 'default' ) : string Get the data link attribute for a setting.
input_attrs ( ) Render the custom attributes for the control's input element.
json ( ) : array Get the data to export to the client via JSON.
link ( string $setting_key = 'default' ) Render the data link attribute for the control's input element.
maybe_render ( ) Check capabilities and render the control.
print_template ( ) Render the control's JS template.
to_json ( ) Refresh the parameters passed to the JavaScript via JSON.
value ( string $setting_key = 'default' ) : mixed Fetch a setting's value.

보호된 메소드들

메소드 설명
content_template ( ) An Underscore (JS) template for this control's content (but not its container).
render ( ) Renders the control wrapper and calls $this->render_content() for the internals.
render_content ( ) Render the control's content.

메소드 상세

__construct() 공개 메소드

Supplied $args override class property defaults. If $args['settings'] is not defined, use the $id as the setting ID.
부터: 3.4.0
public __construct ( WP_Customize_Manager $manager, string $id, array $args = [] )
$manager WP_Customize_Manager Customizer bootstrap instance.
$id string Control ID.
$args array { Optional. Arguments to override class property defaults. @type int $instance_number Order in which this instance was created in relation to other instances. @type WP_Customize_Manager $manager Customizer bootstrap instance. @type string $id Control ID. @type array $settings All settings tied to the control. If undefined, `$id` will be used. @type string $setting The primary setting for the control (if there is one). Default 'default'. @type int $priority Order priority to load the control. Default 10. @type string $section Section the control belongs to. Default empty. @type string $label Label for the control. Default empty. @type string $description Description for the control. Default empty. @type array $choices List of choices for 'radio' or 'select' type controls, where values are the keys, and labels are the values. Default empty array. @type array $input_attrs List of custom input attributes for control output, where attribute names are the keys and values are the values. Not used for 'checkbox', 'radio', 'select', 'textarea', or 'dropdown-pages' control types. Default empty array. @type array $json Deprecated. Use WP_Customize_Control::json() instead. @type string $type Control type. Core controls include 'text', 'checkbox', 'textarea', 'radio', 'select', and 'dropdown-pages'. Additional input types such as 'email', 'url', 'number', 'hidden', and 'date' are supported implicitly. Default 'text'. }

active() 최종 공개 메소드

Check whether control is active to current Customizer preview.
부터: 4.0.0
final public active ( ) : boolean
리턴 boolean Whether the control is active to the current preview.

active_callback() 공개 메소드

Subclasses can override this with their specific logic, or they may provide an 'active_callback' argument to the constructor.
부터: 4.0.0
public active_callback ( ) : true
리턴 true Always true.

check_capabilities() 최종 공개 메소드

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.
부터: 3.4.0
final public check_capabilities ( ) : boolean
리턴 boolean False if theme doesn't support the control or user doesn't have the required permissions, otherwise true.

content_template() 보호된 메소드

Class variables for this control class are available in the data JS object; export custom variables by overriding WP_Customize_Control::to_json().
또한 보기: WP_Customize_Control::print_template()
부터: 4.1.0
protected content_template ( )

enqueue() 공개 메소드

Enqueue control related scripts/styles.
부터: 3.4.0
public enqueue ( )

get_content() 최종 공개 메소드

Get the control's content for insertion into the Customizer pane.
부터: 4.1.0
final public get_content ( ) : string
리턴 string Contents of the control.

input_attrs() 공개 메소드

Render the custom attributes for the control's input element.
부터: 4.0.0
public input_attrs ( )

json() 공개 메소드

Get the data to export to the client via JSON.
부터: 4.1.0
public json ( ) : array
리턴 array Array of parameters passed to the JavaScript.

maybe_render() 최종 공개 메소드

Check capabilities and render the control.
부터: 3.4.0
final public maybe_render ( )

print_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.
부터: 4.1.0
final public print_template ( )

render() 보호된 메소드

Renders the control wrapper and calls $this->render_content() for the internals.
부터: 3.4.0
protected render ( )

render_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().
부터: 3.4.0
protected render_content ( )

to_json() 공개 메소드

Refresh the parameters passed to the JavaScript via JSON.
부터: 3.4.0
public to_json ( )

value() 최종 공개 메소드

Grabs the main setting by default.
부터: 3.4.0
final public value ( string $setting_key = 'default' ) : mixed
$setting_key string
리턴 mixed The requested setting's value, if the setting exists.

프로퍼티 상세

$active_callback 공개적으로 프로퍼티

Callback.
또한 보기: WP_Customize_Control::active()
부터: 4.0.0
public $active_callback

$allow_addition 공개적으로 프로퍼티

Show UI for adding new content, currently only used for the dropdown-pages control.
부터: 4.7.0
public bool $allow_addition
리턴 boolean

$capability 공개적으로 프로퍼티

Normally this is empty and the capability is derived from the capabilities of the associated $settings.
부터: 4.5.0
public string $capability
리턴 string

$choices 공개적으로 프로퍼티

public array $choices
리턴 array

$description 공개적으로 프로퍼티

public string $description
리턴 string

$id 공개적으로 프로퍼티

public string $id
리턴 string

$input_attrs 공개적으로 프로퍼티

public array $input_attrs
리턴 array

$instance_count 보호되어 있는 정적으로 프로퍼티

Used when sorting two instances whose priorities are equal.
부터: 4.1.0
protected static int $instance_count
리턴 integer

$instance_number 공개적으로 프로퍼티

Order in which this instance was created in relation to other instances.
부터: 4.1.0
public int $instance_number
리턴 integer

$json 공개적으로 프로퍼티

사용 중단: It is better to just call the json() method
public array $json
리턴 array

$label 공개적으로 프로퍼티

public string $label
리턴 string

$manager 공개적으로 프로퍼티

public WP_Customize_Manager $manager
리턴 WP_Customize_Manager

$priority 공개적으로 프로퍼티

public int $priority
리턴 integer

$section 공개적으로 프로퍼티

public string $section
리턴 string

$setting 공개적으로 프로퍼티

The primary setting for the control (if there is one).
public string $setting
리턴 string

$settings 공개적으로 프로퍼티

All settings tied to the control.
public array $settings
리턴 array

$type 공개적으로 프로퍼티

public string $type
리턴 string