Make WordPress Core

Changeset 60055


Ignore:
Timestamp:
03/19/2025 06:44:41 PM (6 weeks ago)
Author:
joedolson
Message:

Themes: A11y: Merge omitted changes to support focus-visible.

Merge PHP changes to ensure that focus doesn't match focus-visible in WP_Theme_JSON, overlooked in previous merge. Follow up to [59854].

Props huubl, joemcgill, joedolson.
Fixes #62906.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json.php

    r59854 r60055  
    29072907                $element_pseudo_allowed,
    29082908                static function ( $pseudo_selector ) use ( $selector ) {
    2909                     return str_contains( $selector, $pseudo_selector );
     2909                    /*
     2910                     * Check if the pseudo selector is in the current selector,
     2911                     * ensuring it is not followed by a dash (e.g., :focus should not match :focus-visible).
     2912                     */
     2913                    return preg_match( '/' . preg_quote( $pseudo_selector, '/' ) . '(?!-)/', $selector ) === 1;
    29102914                }
    29112915            )
Note: See TracChangeset for help on using the changeset viewer.