Make WordPress Core


Ignore:
Timestamp:
02/09/2020 04:52:28 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use Yoda conditions where appropriate.

See #49222.

File:
1 edited

Legend:

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

    r47198 r47219  
    193193    $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );
    194194
    195     if ( ( ! empty( $email ) ) && ( $email != '@' ) ) {
    196         $display = ( $linktext != '' ) ? $linktext : $email;
     195    if ( ( ! empty( $email ) ) && ( '@' !== $email ) ) {
     196        $display = ( '' != $linktext ) ? $linktext : $email;
    197197        $return  = $before;
    198198        $return .= sprintf( '<a href="%1$s">%2$s</a>', esc_url( 'mailto:' . $email ), esc_html( $display ) );
     
    377377function get_comment_author_url_link( $linktext = '', $before = '', $after = '', $comment = 0 ) {
    378378    $url     = get_comment_author_url( $comment );
    379     $display = ( $linktext != '' ) ? $linktext : $url;
     379    $display = ( '' != $linktext ) ? $linktext : $url;
    380380    $display = str_replace( 'http://www.', '', $display );
    381381    $display = str_replace( 'http://', '', $display );
     
    926926            $output = str_replace( '%', number_format_i18n( $number ), $more );
    927927        }
    928     } elseif ( $number == 0 ) {
     928    } elseif ( 0 == $number ) {
    929929        $output = ( false === $zero ) ? __( 'No Comments' ) : $zero;
    930930    } else { // Must be one.
     
    21392139                    * the comment permalink.
    21402140                    */
    2141                 } elseif ( $cpage == 1 ) {
     2141                } elseif ( 1 == $cpage ) {
    21422142                    $parsed_args['cpage'] = '';
    21432143                } else {
Note: See TracChangeset for help on using the changeset viewer.