Converts each style section into a list of rulesets containing the block styles to be appended to the stylesheet.
See glossary at https://developer.mozilla.org/en-US/docs/Web/CSS/Syntax
For each section this creates a new ruleset such as:
block-selector { style-property-one: value; }
$style_nodesarrayrequired
if ( ! is_array( $tree ) ) {
return $tree;
}
foreach ( $tree as $key => $value ) {
// Remove keys not in the schema or with null/empty values.
if ( ! array_key_exists( $key, $schema ) ) {
unset( $tree[ $key ] );
continue;
}
if ( is_array( $schema[ $key ] ) ) {
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme_json/get_block_classes