wp_style_engine_get_stylesheet_from_context()WP 6.1.0

Returns compiled CSS from a store, if found.

Хуков нет.

Возвращает

Строку. A compiled CSS string.

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

wp_style_engine_get_stylesheet_from_context( $context, $options );
$context(строка) (обязательный)
A valid context name, corresponding to an existing store key.
$options(массив)

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.
    По умолчанию: whether the SCRIPT_DEBUG constant is defined

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

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

Код wp_style_engine_get_stylesheet_from_context() WP 6.4.3

function wp_style_engine_get_stylesheet_from_context( $context, $options = array() ) {
	return WP_Style_Engine::compile_stylesheet_from_css_rules( WP_Style_Engine::get_store( $context )->get_all_rules(), $options );
}