From 5de0d45b90b3da7d00602dee365550cb126b2852 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Tue, 25 Jul 2017 16:04:50 +0000 Subject: [PATCH] Administration: WP_Screen: strip all tags from the columns display name. This ensures all the column titles, not just the Comments column one, are "clean" when later reused for the Screen Options checkboxes. Also introduces some consistency with what is already done in WP_List_Table. Fixes #41261. git-svn-id: https://develop.svn.wordpress.org/trunk@41148 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-screen.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php index b92ad5c7be..78bb710b65 100644 --- a/src/wp-admin/includes/class-wp-screen.php +++ b/src/wp-admin/includes/class-wp-screen.php @@ -1085,9 +1085,12 @@ final class WP_Screen { continue; } - if ( 'comments' == $column ) { - $title = __( 'Comments' ); - } + /* + * The Comments column uses HTML in the display name with some screen + * reader text. Make sure to strip tags from the Comments column + * title and any other custom column title plugins might add. + */ + $title = wp_strip_all_tags( $title ); $id = "$column-hide"; echo '