diff --git a/src/wp-includes/class-wp-theme-json.php b/src/wp-includes/class-wp-theme-json.php index 20f15e015bfca..32eb56823a90c 100644 --- a/src/wp-includes/class-wp-theme-json.php +++ b/src/wp-includes/class-wp-theme-json.php @@ -791,6 +791,9 @@ protected static function sanitize( $input, $valid_block_names, $valid_element_n * @return string The new selector. */ protected static function append_to_selector( $selector, $to_append, $position = 'right' ) { + if ( ! str_contains( $selector, ',' ) ) { + return 'right' === $position ? $selector . $to_append : $to_append . $selector; + } $new_selectors = array(); $selectors = explode( ',', $selector ); foreach ( $selectors as $sel ) {