diff --git a/wp-includes/class-wp-theme-json.php b/wp-includes/class-wp-theme-json.php index cf8b7961e5..f3f015ccd3 100644 --- a/wp-includes/class-wp-theme-json.php +++ b/wp-includes/class-wp-theme-json.php @@ -2906,7 +2906,11 @@ class WP_Theme_JSON { array_filter( $element_pseudo_allowed, static function ( $pseudo_selector ) use ( $selector ) { - return str_contains( $selector, $pseudo_selector ); + /* + * Check if the pseudo selector is in the current selector, + * ensuring it is not followed by a dash (e.g., :focus should not match :focus-visible). + */ + return preg_match( '/' . preg_quote( $pseudo_selector, '/' ) . '(?!-)/', $selector ) === 1; } ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index fb48bcf1bc..31a9e87748 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-beta3-60054'; +$wp_version = '6.8-beta3-60055'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.