Make WordPress Core


Ignore:
Timestamp:
07/02/2019 11:41:16 PM (5 years ago)
Author:
pento
Message:

Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes.

See #47632.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r45580 r45590  
    2626
    2727    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 ) {
    2930            $author = $user->display_name;
    3031        } else {
     
    149150 */
    150151function 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 ) {
    152154        echo $link;
    153155    }
     
    467469
    468470    // 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 ) {
    470473        $classes[] = 'byuser';
    471474        $classes[] = 'comment-author-' . sanitize_html_class( $user->user_nicename, $comment->user_id );
    472475        // 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 ) {
    474478            if ( $comment->user_id === $post->post_author ) {
    475479                $classes[] = 'bypostauthor';
     
    19901994    $in_comment_loop = true;
    19911995
    1992     $comment_alt   = $comment_thread_alt = 0;
    1993     $comment_depth = 1;
     1996    $comment_alt        = 0;
     1997    $comment_thread_alt = 0;
     1998    $comment_depth      = 1;
    19941999
    19952000    $defaults = array(
Note: See TracChangeset for help on using the changeset viewer.