Make WordPress Core

Changeset 61142


Ignore:
Timestamp:
11/05/2025 04:21:28 PM (9 months ago)
Author:
cbravobernal
Message:

Command Palette: Revert Use HTLM_Tag_Processor to get the menu label when enqueueing assets.

Reverts [61126] and [61127], which introduced a bug where the command palette is not stripping numbers. HTML_Tag_Processor cannot replace the REGEX yet.

Unprops cbravobernal.

Follow-up to [61126], [61127].

Props wildworks, tusharaddweb.
See #64196.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r61127 r61142  
    34433443
    34443444                        // Remove all HTML tags and their contents.
    3445                         $processor  = new WP_HTML_Tag_Processor( $menu_item[0] );
    3446                         $menu_label = '';
    3447                         while ( $processor->next_token() ) {
    3448                                 if ( '#text' === $processor->get_token_name() ) {
    3449                                         $menu_label .= $processor->get_modifiable_text();
    3450                                 }
     3445                        $menu_label = $menu_item[0];
     3446                        while ( preg_match( '/<[^>]*>/', $menu_label ) ) {
     3447                                $menu_label = preg_replace( '/<[^>]*>.*?<\/[^>]*>|<[^>]*\/>|<[^>]*>/s', '', $menu_label );
    34513448                        }
    34523449                        $menu_label = trim( $menu_label );
     
    34753472
    34763473                                        // Remove all HTML tags and their contents.
    3477                                         $processor     = new WP_HTML_Tag_Processor( $submenu_item[0] );
    3478                                         $submenu_label = '';
    3479                                         while ( $processor->next_token() ) {
    3480                                                 if ( '#text' === $processor->get_token_name() ) {
    3481                                                         $submenu_label .= $processor->get_modifiable_text();
    3482                                                 }
     3474                                        $submenu_label = $submenu_item[0];
     3475                                        while ( preg_match( '/<[^>]*>/', $submenu_label ) ) {
     3476                                                $submenu_label = preg_replace( '/<[^>]*>.*?<\/[^>]*>|<[^>]*\/>|<[^>]*>/s', '', $submenu_label );
    34833477                                        }
    34843478                                        $submenu_label = trim( $submenu_label );
Note: See TracChangeset for help on using the changeset viewer.