From d03b453438feaf5da0e48ce72ea103d7c8e631fe Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Tue, 24 Jan 2023 10:18:24 +0200 Subject: [PATCH] Remove use of WP_HTML_Tag_Processor --- packages/block-library/src/navigation-submenu/index.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/block-library/src/navigation-submenu/index.php b/packages/block-library/src/navigation-submenu/index.php index f3c8cad8f0ca89..40abbee928b135 100644 --- a/packages/block-library/src/navigation-submenu/index.php +++ b/packages/block-library/src/navigation-submenu/index.php @@ -256,11 +256,7 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) { } if ( strpos( $inner_blocks_html, 'current-menu-item' ) ) { - $tag_processor = new WP_HTML_Tag_Processor( $html ); - while ( $tag_processor->next_tag( array( 'class_name' => 'wp-block-navigation-item__content' ) ) ) { - $tag_processor->add_class( 'current-menu-ancestor' ); - } - $html = $tag_processor->get_updated_html(); + $html = str_replace( 'wp-block-navigation-item__content', 'wp-block-navigation-item__content current-menu-ancestor', $html ); } $html .= sprintf(