Introduce sanitise_css_classname() and use it to give categories, tags, users etc meaningful classnames where possible. Falls back to the id if not. Fixes #8446.
git-svn-id: http://svn.automattic.com/wordpress/trunk@11433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -294,7 +294,7 @@ function get_comment_class( $class = '', $comment_id = null, $post_id = null ) {
|
||||
if ( $comment->user_id > 0 && $user = get_userdata($comment->user_id) ) {
|
||||
// For all registered users, 'byuser'
|
||||
$classes[] = 'byuser';
|
||||
$classes[] = 'comment-author-' . $comment->user_id;
|
||||
$classes[] = 'comment-author-' . sanitise_css_classname($user->user_nicename, $comment->user_id);
|
||||
// For comment authors who are the author of the post
|
||||
if ( $post = get_post($post_id) ) {
|
||||
if ( $comment->user_id === $post->post_author )
|
||||
|
||||
Reference in New Issue
Block a user