Reference › WP_Style_Engine WP_Style_Engine::compile_stylesheet_from_css_rules ( WP_Style_Engine_CSS_Rule[] $css_rules , array $options = array() ): string
Since 6.1.0
Source wp-includes/style-engine/class-wp-style-engine.php:767Parameters Return Uses Used by Source History Returns a compiled stylesheet from stored CSS rules.
Parameters
$css_rulesWP_Style_Engine_CSS_Rule[] An array of WP_Style_Engine_CSS_Rule objects from a store or otherwise. $optionsarray optional An array of options. Default empty array.Default: array() $contextstring | nulldefault: 'block-supports'. When set, the style engine will attempt to store the CSS rules
An identifier describing the origin of the style object, e.g. 'block-supports' or 'global-styles'.
$optimizebool default: false
Whether to optimize the CSS output, e.g. combine rules.
$prettifybool
Whether to add new lines and indents to output. Defaults to whether the SCRIPT_DEBUG constant is defined.
Return
string A compiled stylesheet from stored CSS rules. Uses · 1 WP_Style_Engine_Processor::__construct() Source View on Trac ↗ View on GitHub ↗
767 public static function compile_stylesheet_from_css_rules ( $css_rules , $options = array ( ) ) { 768 $processor = new WP_Style_Engine_Processor ( ) ; 769 $processor -> add_rules ( $css_rules ) ; 770 return $processor -> get_css ( $options ) ; 771 } History Introduced in 6.1.0 . Unchanged from 6.7.7 through 7.1.0.
6.7.7 6.8.8 6.9.7 7.0.4 7.1.0 Signature, return type and hooks compared across 5 parsed releases.
About this page Parsed data Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/style-engine/class-wp-style-engine.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. Corrections Something wrong on this page? Report it and it gets fixed in the next regeneration.