PHP Класс WP_Customize_Custom_CSS_Setting, wordpress

См. также: WP_Customize_Setting
С версии: 4.7.0
Наследование: extends WP_Customize_Setting
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$capability string Capability required to edit this setting.
$stylesheet string Stylesheet
$transport string Setting Transport
$type string The setting type.

Открытые методы

Метод Описание
__construct ( WP_Customize_Manager $manager, string $id, array $args = [] ) WP_Customize_Custom_CSS_Setting constructor.
filter_previewed_wp_get_custom_css ( string $css, string $stylesheet ) : string Filter wp_get_custom_css for applying the customized value.
preview ( ) : boolean Add filter to preview post value.
update ( string $css ) : integer | false Store the CSS setting value in the custom_css custom post type for the stylesheet.
validate ( string $css ) : true | WP_Error Validate CSS.
value ( ) : string Fetch the value of the setting. Will return the previewed value when preview() is called.

Приватные методы

Метод Описание
is_possible_content_error ( string $css ) : boolean Find "content:" within a string.
validate_balanced_characters ( string $opening_char, string $closing_char, string $css ) : boolean Ensure there are a balanced number of paired characters.
validate_count_unclosed_comments ( string $css ) : integer Count unclosed CSS Comments.
validate_equal_characters ( string $char, string $css ) : boolean Ensure there are an even number of paired characters.

Описание методов

__construct() публичный Метод

WP_Customize_Custom_CSS_Setting constructor.
С версии: 4.7.0
public __construct ( WP_Customize_Manager $manager, string $id, array $args = [] )
$manager WP_Customize_Manager The Customize Manager class.
$id string An specific ID of the setting. Can be a theme mod or option name.
$args array Setting arguments.

filter_previewed_wp_get_custom_css() публичный Метод

This is used in the preview when wp_get_custom_css() is called for rendering the styles.
См. также: wp_get_custom_css()
С версии: 4.7.0
public filter_previewed_wp_get_custom_css ( string $css, string $stylesheet ) : string
$css string Original CSS.
$stylesheet string Current stylesheet.
Результат string CSS.

preview() публичный Метод

Add filter to preview post value.
С версии: 4.7.9
public preview ( ) : boolean
Результат boolean False when preview short-circuits due no change needing to be previewed.

update() публичный Метод

Store the CSS setting value in the custom_css custom post type for the stylesheet.
С версии: 4.7.0
public update ( string $css ) : integer | false
$css string The input value.
Результат integer | false The post ID or false if the value could not be saved.

validate() публичный Метод

Checks for imbalanced braces, brackets, and comments. Notifications are rendered when the customizer state is saved.
С версии: 4.7.0
public validate ( string $css ) : true | WP_Error
$css string The input string.
Результат true | WP_Error True if the input was validated, otherwise WP_Error.

value() публичный Метод

Fetch the value of the setting. Will return the previewed value when preview() is called.
См. также: WP_Customize_Setting::value()
С версии: 4.7.0
public value ( ) : string
Результат string

Описание свойств

$capability публичное свойство

Capability required to edit this setting.
С версии: 4.7.0
public string $capability
Результат string

$stylesheet публичное свойство

Stylesheet
С версии: 4.7.0
public string $stylesheet
Результат string

$transport публичное свойство

Setting Transport
С версии: 4.7.0
public string $transport
Результат string

$type публичное свойство

The setting type.
С версии: 4.7.0
public string $type
Результат string