WordPress.org

Make WordPress Core

Ticket #16944: 16944.diff

File 16944.diff, 1.1 KB (added by solarissmoke, 7 years ago)
  • wp-includes/comment-template.php

     
    307307        $classes[] = ( empty( $comment->comment_type ) ) ? 'comment' : $comment->comment_type;
    308308
    309309        // If the comment author has an id (registered), then print the log in name
    310         if ( $comment->user_id > 0 && $user = get_userdata($comment->user_id) ) {
    311                 // For all registered users, 'byuser'
     310        if ( $comment->user_id > 0 && $user = get_userdata( $comment->user_id ) ) {
     311                // For all registered users (site-wide), 'byuser'
    312312                $classes[] = 'byuser';
    313313                $classes[] = 'comment-author-' . sanitize_html_class($user->user_nicename, $comment->user_id);
     314               
     315                // For current blog users
     316                if ( ! is_multisite() || is_user_member_of_blog( $comment->user_id ) )
     317                        $classes[] = 'by-blog-user';
     318                       
    314319                // For comment authors who are the author of the post
    315                 if ( $post = get_post($post_id) ) {
     320                if ( $post = get_post( $post_id ) ) {
    316321                        if ( $comment->user_id === $post->post_author )
    317322                                $classes[] = 'bypostauthor';
    318323                }