WP_Style_Engine::compile_stylesheet_from_css_rules()public staticWP 6.1.0

Returns a compiled stylesheet from stored CSS rules.

Метод класса: WP_Style_Engine{}

Хуков нет.


Строку. A compiled stylesheet from stored CSS rules.


$result = WP_Style_Engine::compile_stylesheet_from_css_rules( $css_rules, $options );
$css_rules(WP_Style_Engine_CSS_Rule[]) (обязательный)
An array of WP_Style_Engine_CSS_Rule objects from a store or otherwise.

An array of options.

По умолчанию: empty array

  • optimize(true|false)
    Whether to optimize the CSS output, e.g., combine rules.
    По умолчанию: false

  • prettify(true|false)
    Whether to add new lines and indents to output.
    По умолчанию: test of whether the global constant SCRIPT_DEBUG is defined

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

С версии 6.1.0 Введена.

Код WP_Style_Engine::compile_stylesheet_from_css_rules() WP 6.1.1

public static function compile_stylesheet_from_css_rules( $css_rules, $options = array() ) {
	$processor = new WP_Style_Engine_Processor();
	$processor->add_rules( $css_rules );
	return $processor->get_css( $options );