On this page
WP_Style_Engine::compile_stylesheet_from_css_rules( WP_Style_Engine_CSS_Rule[] $css_rules, array $options = array() ): string
Returns a compiled stylesheet from stored CSS rules.
Parameters
$css_rulesWP_Style_Engine_CSS_Rule[] Required-
An array of WP_Style_Engine_CSS_Rule objects from a store or otherwise.
$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 stylesheet from stored CSS rules.
Source
File: wp-includes/style-engine/class-wp-style-engine.php. View all references
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 );
}
Related
Used By
| Used By | Description |
|---|---|
| wp_style_engine_get_stylesheet_from_css_rules() wp-includes/style-engine.php | Returns compiled CSS from a collection of selectors and declarations. |
| wp_style_engine_get_stylesheet_from_context() wp-includes/style-engine.php | Returns compiled CSS from a store, if found. |
Changelog
| Version | Description |
|---|---|
| 6.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_style_engine/compile_stylesheet_from_css_rules