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
This commit is contained in:
Andrea Fercia 2017-07-25 16:04:50 +00:00
parent 5508cdedba
commit 5de0d45b90
1 changed files with 6 additions and 3 deletions

View File

@ -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 '<label>';