PHP 클래스 Kirki_Field, kirki

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

보호된 프로퍼티들

프로퍼티 타입 설명
$active_callback string | array A custom callback to determine if the field should be visible or not.
$capability string Thje capability required so that users can edit this field.
$choices array We're whitelisting the property here and suggest you validate this in a child class.
$default string | array The default value for this field.
$disable_output boolean Set to true if you want to disable all CSS output for this field.
$flex_height boolean Whether the height is flexible for cropped image.
$flex_width boolean Whether the width is flexible for cropped image.
$height integer Suggested height for cropped image.
$help string Whitelisting for backwards-compatibility.
$id string This is auto-calculated from the $settings argument.
$input_attrs array Vustom input attributes (defined as an array).
$js_vars array Not necessary to use if you use 'transport' => 'auto' and have already set an array for the 'output' argument.
$kirki_config string The ID of the kirki_config we're using.
$mime_type array Limit the Media library to a specific mime type
$mode string Whitelisting for backwards-compatibility.
$multiple integer Defines if this is a multi-select or not. If value is > 1, then the maximum number of selectable options is the number defined here.
$option_name string If we're using options instead of theme_mods and we want them serialized, this is the option that will saved in the db.
$option_type string Use "theme_mod" or "option".
$output array Use if you want to automatically generate CSS from this field's value.
$partial_refresh array Partial Refreshes array.
$priority integer Lower priority numbers move the control to the top.
$required array Define dependencies to show/hide this field based on the values of other fields.
$row_label array Contain the settings for the repeater rows labels
$sanitize_callback string | array A custom sanitize callback that will be used to properly save the values.
$section string Fields not assigned to a section will not be displayed in the customizer.
$settings string | array The name of this setting (id for the db).
$tooltip string Text that will be used in a tooltip to provide extra info for this field.
$transport string 'auto' will automatically geberate any 'js_vars' from the 'output' argument.
$type string The field type.
$variables array If you want to use a CSS compiler, then use this to set the variable names.
$width integer Suggested width for cropped image.

공개 메소드들

메소드 설명
__construct ( string $config_id = 'global', array $args = [] ) The class constructor.

보호된 메소드들

메소드 설명
set_active_callback ( ) Sets the active_callback If we're using the $required argument, Then this is where the switch is made to our evaluation method.
set_capability ( ) Checks the capability chosen is valid.
set_choices ( ) Sets the $choices.
set_default ( ) This allows us to process this on a field-basis by using sub-classes which can override this method.
set_disable_output ( ) Escapes the $disable_output.
set_field ( array $whitelisted_properties = [] ) Processes the field arguments
set_help ( ) This is a fallback method: $help has now become $tooltip, so this just migrates the data
set_id ( ) Sets the $id.
set_input_attrs ( ) Escape the $section.
set_js_vars ( ) Sets the $js_vars
set_kirki_config ( ) Escape $kirki_config.
set_multiple ( ) Sets the $multiple
set_option_name ( ) Escape $option_name.
set_option_type ( ) Make sure we're using the correct option_type
set_output ( ) Sets the $sanitize_callback
set_partial_refresh ( ) Modifications for partial refreshes.
set_priority ( ) Sets the $priority
set_required ( ) Sets the $required
set_sanitize_callback ( ) Sets the $sanitize_callback
set_section ( ) Escape the $section.
set_settings ( ) Sets the settings.
set_tooltip ( ) Escapes the tooltip messages.
set_transport ( ) Sets the $transport
set_type ( ) Sets the control type.
set_variables ( ) Sets the $variables

메소드 상세

__construct() 공개 메소드

Parses and sanitizes all field arguments. Then it adds the field to Kirki::$fields.
public __construct ( string $config_id = 'global', array $args = [] )
$config_id string The ID of the config we want to use. Defaults to "global". Configs are handled by the Kirki_Config class.
$args array The arguments of the field.

set_active_callback() 보호된 메소드

Sets the active_callback If we're using the $required argument, Then this is where the switch is made to our evaluation method.
protected set_active_callback ( )

set_capability() 보호된 메소드

If not, then falls back to 'edit_theme_options'
protected set_capability ( )

set_choices() 보호된 메소드

Sets the $choices.
protected set_choices ( )

set_default() 보호된 메소드

This allows us to process this on a field-basis by using sub-classes which can override this method.
protected set_default ( )

set_disable_output() 보호된 메소드

Escapes the $disable_output.
protected set_disable_output ( )

set_field() 보호된 메소드

Processes the field arguments
protected set_field ( array $whitelisted_properties = [] )
$whitelisted_properties array Defines an array of arguments that will skip validation at this point.

set_help() 보호된 메소드

This is a fallback method: $help has now become $tooltip, so this just migrates the data
protected set_help ( )

set_id() 보호된 메소드

Setting the ID should happen after the 'settings' sanitization. This way we can also properly handle cases where the option_type is set to 'option' and we're using an array instead of individual options.
protected set_id ( )

set_input_attrs() 보호된 메소드

Escape the $section.
protected set_input_attrs ( )

set_js_vars() 보호된 메소드

Sets the $js_vars
protected set_js_vars ( )

set_kirki_config() 보호된 메소드

Escape $kirki_config.
protected set_kirki_config ( )

set_multiple() 보호된 메소드

Sets the $multiple
protected set_multiple ( )

set_option_name() 보호된 메소드

Escape $option_name.
protected set_option_name ( )

set_option_type() 보호된 메소드

Make sure we're using the correct option_type
protected set_option_type ( )

set_output() 보호된 메소드

Sets the $sanitize_callback
protected set_output ( )

set_partial_refresh() 보호된 메소드

Modifications for partial refreshes.
protected set_partial_refresh ( )

set_priority() 보호된 메소드

Sets the $priority
protected set_priority ( )

set_required() 보호된 메소드

Sets the $required
protected set_required ( )

set_sanitize_callback() 보호된 메소드

Sets the $sanitize_callback
protected set_sanitize_callback ( )

set_section() 보호된 메소드

Escape the $section.
protected set_section ( )

set_settings() 보호된 메소드

If we're using serialized options it makes sure that settings are properly formatted. We'll also be escaping all setting names here for consistency.
protected set_settings ( )

set_tooltip() 보호된 메소드

Escapes the tooltip messages.
protected set_tooltip ( )

set_transport() 보호된 메소드

Sets the $transport
protected set_transport ( )

set_type() 보호된 메소드

Sets the control type.
protected set_type ( )

set_variables() 보호된 메소드

Sets the $variables
protected set_variables ( )

프로퍼티 상세

$active_callback 보호되어 있는 프로퍼티

A custom callback to determine if the field should be visible or not.
protected string|array $active_callback
리턴 string | array

$capability 보호되어 있는 프로퍼티

Thje capability required so that users can edit this field.
protected string $capability
리턴 string

$choices 보호되어 있는 프로퍼티

We're whitelisting the property here and suggest you validate this in a child class.
protected array $choices
리턴 array

$default 보호되어 있는 프로퍼티

The default value for this field.
protected string|array $default
리턴 string | array

$disable_output 보호되어 있는 프로퍼티

Set to true if you want to disable all CSS output for this field.
protected bool $disable_output
리턴 boolean

$flex_height 보호되어 있는 프로퍼티

Whether the height is flexible for cropped image.
protected bool $flex_height
리턴 boolean

$flex_width 보호되어 있는 프로퍼티

Whether the width is flexible for cropped image.
protected bool $flex_width
리턴 boolean

$height 보호되어 있는 프로퍼티

Suggested height for cropped image.
protected int $height
리턴 integer

$help 보호되어 있는 프로퍼티

Whitelisting for backwards-compatibility.
protected string $help
리턴 string

$id 보호되어 있는 프로퍼티

This is auto-calculated from the $settings argument.
protected string $id
리턴 string

$input_attrs 보호되어 있는 프로퍼티

Vustom input attributes (defined as an array).
protected array $input_attrs
리턴 array

$js_vars 보호되어 있는 프로퍼티

Not necessary to use if you use 'transport' => 'auto' and have already set an array for the 'output' argument.
또한 보기: https://kirki.org/docs/arguments/js_vars
protected array $js_vars
리턴 array

$kirki_config 보호되어 있는 프로퍼티

The ID of the kirki_config we're using.
또한 보기: Kirki_Config
protected string $kirki_config
리턴 string

$mime_type 보호되어 있는 프로퍼티

Limit the Media library to a specific mime type
protected array $mime_type
리턴 array

$mode 보호되어 있는 프로퍼티

Whitelisting for backwards-compatibility.
protected string $mode
리턴 string

$multiple 보호되어 있는 프로퍼티

Defines if this is a multi-select or not. If value is > 1, then the maximum number of selectable options is the number defined here.
protected int $multiple
리턴 integer

$option_name 보호되어 있는 프로퍼티

If we're using options instead of theme_mods and we want them serialized, this is the option that will saved in the db.
protected string $option_name
리턴 string

$option_type 보호되어 있는 프로퍼티

Use "theme_mod" or "option".
protected string $option_type
리턴 string

$output 보호되어 있는 프로퍼티

Use if you want to automatically generate CSS from this field's value.
또한 보기: https://kirki.org/docs/arguments/output
protected array $output
리턴 array

$partial_refresh 보호되어 있는 프로퍼티

Partial Refreshes array.
protected array $partial_refresh
리턴 array

$priority 보호되어 있는 프로퍼티

Lower priority numbers move the control to the top.
protected int $priority
리턴 integer

$required 보호되어 있는 프로퍼티

Define dependencies to show/hide this field based on the values of other fields.
protected array $required
리턴 array

$row_label 보호되어 있는 프로퍼티

Contain the settings for the repeater rows labels
protected array $row_label
리턴 array

$sanitize_callback 보호되어 있는 프로퍼티

A custom sanitize callback that will be used to properly save the values.
protected string|array $sanitize_callback
리턴 string | array

$section 보호되어 있는 프로퍼티

Fields not assigned to a section will not be displayed in the customizer.
protected string $section
리턴 string

$settings 보호되어 있는 프로퍼티

The name of this setting (id for the db).
protected string|array $settings
리턴 string | array

$tooltip 보호되어 있는 프로퍼티

Text that will be used in a tooltip to provide extra info for this field.
protected string $tooltip
리턴 string

$transport 보호되어 있는 프로퍼티

'auto' will automatically geberate any 'js_vars' from the 'output' argument.
protected string $transport
리턴 string

$type 보호되어 있는 프로퍼티

The field type.
protected string $type
리턴 string

$variables 보호되어 있는 프로퍼티

If you want to use a CSS compiler, then use this to set the variable names.
또한 보기: https://kirki.org/docs/arguments/variables
protected array $variables
리턴 array

$width 보호되어 있는 프로퍼티

Suggested width for cropped image.
protected int $width
리턴 integer