W3cubDocs

/WordPress

wp_style_engine_get_stylesheet_from_context( string $context, array $options = array() ): string

Returns compiled CSS from a store, if found.

Parameters

$contextstringrequired
A valid context name, corresponding to an existing store key.
$optionsarrayoptional
An array of options.
  • optimize bool
    Whether to optimize the CSS output, e.g. combine rules.
    Default false.
  • prettify bool
    Whether to add new lines and indents to output.
    Defaults to whether the SCRIPT_DEBUG constant is defined.

Default:array()

Return

string A compiled CSS string.

Source

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 );
}

Changelog

Version Description
6.1.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_style_engine_get_stylesheet_from_context