On this page
wp_style_engine_get_stylesheet_from_context( string $context, array $options = array() ): string
Returns compiled CSS from a store, if found.
Parameters
$contextstring Required-
A valid context name, corresponding to an existing store key.
$optionsarray Optional-
An array of options.
optimizeboolWhether to optimize the CSS output, e.g., combine rules. Default isfalse.prettifyboolWhether to add new lines and indents to output. Default is the test of whether the global constantSCRIPT_DEBUGis defined.
Default:
array()
Return
string A compiled CSS string.
Source
File: wp-includes/style-engine.php. View all references
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 );
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Style_Engine::compile_stylesheet_from_css_rules() wp-includes/style-engine/class-wp-style-engine.php | Returns a compiled stylesheet from stored CSS rules. |
| WP_Style_Engine::get_store() wp-includes/style-engine/class-wp-style-engine.php | Returns a store by store key. |
Used By
| Used By | Description |
|---|---|
| wp_enqueue_stored_styles() wp-includes/script-loader.php | Fetches, processes and compiles stored core styles, then combines and renders them to the page. |
Changelog
| Version | Description |
|---|---|
| 6.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_style_engine_get_stylesheet_from_context