Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where static strings are involved.

This reduces the number of WordPress.PHP.StrictComparisons.LooseComparison issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyeleven/functions.php

    r47219 r47808  
    148148
    149149        $theme_options = twentyeleven_get_theme_options();
    150         if ( 'dark' == $theme_options['color_scheme'] ) {
     150        if ( 'dark' === $theme_options['color_scheme'] ) {
    151151            $default_background_color = '1d1d1d';
    152152        } else {
     
    329329        <?php
    330330        // Has the text been hidden?
    331         if ( 'blank' == $text_color ) :
     331        if ( 'blank' === $text_color ) :
    332332            ?>
    333333        #site-title,
     
    720720                <div class="comment-author vcard">
    721721                    <?php
    722                         $avatar_size = 68;
     722                    $avatar_size = 68;
     723
    723724                    if ( '0' != $comment->comment_parent ) {
    724725                        $avatar_size = 39;
    725726                    }
    726727
    727                         echo get_avatar( $comment, $avatar_size );
    728 
    729                         printf(
    730                             /* translators: 1: Comment author, 2: Date and time. */
    731                             __( '%1$s on %2$s <span class="says">said:</span>', 'twentyeleven' ),
    732                             sprintf( '<span class="fn">%s</span>', get_comment_author_link() ),
    733                             sprintf(
    734                                 '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
    735                                 esc_url( get_comment_link( $comment->comment_ID ) ),
    736                                 get_comment_time( 'c' ),
    737                                 /* translators: 1: Date, 2: Time. */
    738                                 sprintf( __( '%1$s at %2$s', 'twentyeleven' ), get_comment_date(), get_comment_time() )
    739                             )
    740                         );
     728                    echo get_avatar( $comment, $avatar_size );
     729
     730                    printf(
     731                        /* translators: 1: Comment author, 2: Date and time. */
     732                        __( '%1$s on %2$s <span class="says">said:</span>', 'twentyeleven' ),
     733                        sprintf( '<span class="fn">%s</span>', get_comment_author_link() ),
     734                        sprintf(
     735                            '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
     736                            esc_url( get_comment_link( $comment->comment_ID ) ),
     737                            get_comment_time( 'c' ),
     738                            /* translators: 1: Date, 2: Time. */
     739                            sprintf( __( '%1$s at %2$s', 'twentyeleven' ), get_comment_date(), get_comment_time() )
     740                        )
     741                    );
    741742                    ?>
    742743
    743                         <?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
     744                    <?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
    744745                    </div><!-- .comment-author .vcard -->
    745746
Note: See TracChangeset for help on using the changeset viewer.