WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Customize_Custom_CSS_Setting::validate() public WP 4.7.0

Validate CSS.

Checks for imbalanced braces, brackets, and comments. Notifications are rendered when the customizer state is saved.

Это метод класса: WP_Customize_Custom_CSS_Setting{}

Хуков нет.

Возвращает

true/WP_Error. True if the input was validated, otherwise WP_Error.

Использование

$WP_Customize_Custom_CSS_Setting = new WP_Customize_Custom_CSS_Setting();
$WP_Customize_Custom_CSS_Setting->validate( $css );
$css(строка) (обязательный)
The input string.

Список изменений

С версии 4.7.0 Введена.
С версии 4.9.0 Checking for balanced characters has been moved client-side via linting in code editor.

Код WP_Customize_Custom_CSS_Setting::validate() WP 5.5.1

wp-includes/customize/class-wp-customize-custom-css-setting.php
<?php
public function validate( $css ) {
	$validity = new WP_Error();

	if ( preg_match( '#</?\w+#', $css ) ) {
		$validity->add( 'illegal_markup', __( 'Markup is not allowed in CSS.' ) );
	}

	if ( ! $validity->has_errors() ) {
		$validity = parent::validate( $css );
	}
	return $validity;
}