Changeset 45590 for trunk/src/wp-includes/comment-template.php
- Timestamp:
- 07/02/2019 11:41:16 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r45580 r45590 26 26 27 27 if ( empty( $comment->comment_author ) ) { 28 if ( $comment->user_id && $user = get_userdata( $comment->user_id ) ) { 28 $user = $comment->user_id ? get_userdata( $comment->user_id ) : false; 29 if ( $user ) { 29 30 $author = $user->display_name; 30 31 } else { … … 149 150 */ 150 151 function comment_author_email_link( $linktext = '', $before = '', $after = '', $comment = null ) { 151 if ( $link = get_comment_author_email_link( $linktext, $before, $after, $comment ) ) { 152 $link = get_comment_author_email_link( $linktext, $before, $after, $comment ); 153 if ( $link ) { 152 154 echo $link; 153 155 } … … 467 469 468 470 // Add classes for comment authors that are registered users. 469 if ( $comment->user_id > 0 && $user = get_userdata( $comment->user_id ) ) { 471 $user = $comment->user_id ? get_userdata( $comment->user_id ) : false; 472 if ( $user ) { 470 473 $classes[] = 'byuser'; 471 474 $classes[] = 'comment-author-' . sanitize_html_class( $user->user_nicename, $comment->user_id ); 472 475 // For comment authors who are the author of the post 473 if ( $post = get_post( $post_id ) ) { 476 $post = get_post( $post_id ); 477 if ( $post ) { 474 478 if ( $comment->user_id === $post->post_author ) { 475 479 $classes[] = 'bypostauthor'; … … 1990 1994 $in_comment_loop = true; 1991 1995 1992 $comment_alt = $comment_thread_alt = 0; 1993 $comment_depth = 1; 1996 $comment_alt = 0; 1997 $comment_thread_alt = 0; 1998 $comment_depth = 1; 1994 1999 1995 2000 $defaults = array(
Note: See TracChangeset
for help on using the changeset viewer.