PHP Class WP_Customize_Custom_CSS_Setting, wordpress

See also: WP_Customize_Setting
Since: 4.7.0
Inheritance: extends WP_Customize_Setting
Afficher le fichier Open project: johnpbloch/wordpress Class Usage Examples

Méthodes publiques

Свойство Type Description
$capability string Capability required to edit this setting.
$stylesheet string Stylesheet
$transport string Setting Transport
$type string The setting type.

Méthodes publiques

Méthode Description
__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.

Private Methods

Méthode Description
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.

Method Details

__construct() public méthode

WP_Customize_Custom_CSS_Setting constructor.
Since: 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() public méthode

This is used in the preview when wp_get_custom_css() is called for rendering the styles.
See also: wp_get_custom_css()
Since: 4.7.0
public filter_previewed_wp_get_custom_css ( string $css, string $stylesheet ) : string
$css string Original CSS.
$stylesheet string Current stylesheet.
Résultat string CSS.

preview() public méthode

Add filter to preview post value.
Since: 4.7.9
public preview ( ) : boolean
Résultat boolean False when preview short-circuits due no change needing to be previewed.

update() public méthode

Store the CSS setting value in the custom_css custom post type for the stylesheet.
Since: 4.7.0
public update ( string $css ) : integer | false
$css string The input value.
Résultat integer | false The post ID or false if the value could not be saved.

validate() public méthode

Checks for imbalanced braces, brackets, and comments. Notifications are rendered when the customizer state is saved.
Since: 4.7.0
public validate ( string $css ) : true | WP_Error
$css string The input string.
Résultat true | WP_Error True if the input was validated, otherwise WP_Error.

value() public méthode

Fetch the value of the setting. Will return the previewed value when preview() is called.
See also: WP_Customize_Setting::value()
Since: 4.7.0
public value ( ) : string
Résultat string

Property Details

$capability public_oe property

Capability required to edit this setting.
Since: 4.7.0
public string $capability
Résultat string

$stylesheet public_oe property

Stylesheet
Since: 4.7.0
public string $stylesheet
Résultat string

$transport public_oe property

Setting Transport
Since: 4.7.0
public string $transport
Résultat string

$type public_oe property

The setting type.
Since: 4.7.0
public string $type
Résultat string