From 5b88e2fa5315d4514f8f44de93e223411591a718 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 16 Mar 2020 01:30:14 +0000 Subject: [PATCH] Menus: When adding a label for special pages in `wp_setup_nav_menu_item()` strip all HTML tags, as the label is escaped on output. Follow-up to [47211], [47213]. Props stiofansisland. Fixes #49374. git-svn-id: https://develop.svn.wordpress.org/trunk@47458 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/nav-menu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/nav-menu.php b/src/wp-includes/nav-menu.php index 3493961794..12d5c31ba2 100644 --- a/src/wp-includes/nav-menu.php +++ b/src/wp-includes/nav-menu.php @@ -822,7 +822,7 @@ function wp_setup_nav_menu_item( $menu_item ) { $menu_post = get_post( $menu_item->object_id ); $post_states = get_post_states( $menu_post ); if ( $post_states ) { - $menu_item->type_label = implode( ',', $post_states ); + $menu_item->type_label = wp_strip_all_tags( implode( ', ', $post_states ) ); } } } else {