Editor: Update util for scoping CSS selectors.

Adds early return for existing scope_selector method in preparation for extending block style variations.

Props aaronrobertshaw, audrasjb, isabel_brison.
Fixes #61120.

Built from https://develop.svn.wordpress.org/trunk@58245


git-svn-id: http://core.svn.wordpress.org/trunk@57708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
isabel_brison 2024-05-30 05:22:05 +00:00
parent 6f9de6388c
commit bfab5160b3
2 changed files with 6 additions and 1 deletions

View File

@ -1797,12 +1797,17 @@ class WP_Theme_JSON {
* </code>
*
* @since 5.9.0
* @since 6.6.0 Added early return if missing scope or selector.
*
* @param string $scope Selector to scope to.
* @param string $selector Original selector.
* @return string Scoped selector.
*/
public static function scope_selector( $scope, $selector ) {
if ( ! $scope || ! $selector ) {
return $selector;
}
$scopes = explode( ',', $scope );
$selectors = explode( ',', $selector );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-alpha-58244';
$wp_version = '6.6-alpha-58245';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.