Prepends a sub-selector to an existing one.
Description
Given the compounded $selector "h1, h2, h3" and the $to_prepend selector ".some-class " the result will be ".some-class h1, .some-class h2, .some-class h3".
Parameters
$selector
stringrequired- Original selector.
$to_prepend
stringrequired- Selector to prepend.
Source
if ( empty( $theme_json['styles']['variations'] ) || empty( $valid_variations ) ) {
return $theme_json;
}
$new_theme_json = $theme_json;
$variations = $new_theme_json['styles']['variations'];
foreach ( $valid_variations as $block_type => $registered_variations ) {
foreach ( $registered_variations as $variation_name ) {
$block_level_data = $new_theme_json['styles']['blocks'][ $block_type ]['variations'][ $variation_name ] ?? array();
$top_level_data = $variations[ $variation_name ] ?? array();
Changelog
Version | Description |
---|---|
6.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.