Make WordPress Core


Ignore:
Timestamp:
02/24/2023 06:21:21 AM (2 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in bundled themes' PHP files.

This addresses all the remaining WPCS warnings in bundled themes.

Includes using the correct type when checking the number of comments, as get_comments_number() returns a numeric string, not an integer.

Follow-up to [41285], [44562], [47941].

Props aristath, poena, afercia, SergeyBiryukov.
See #56791.

File:
1 edited

Legend:

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

    r54492 r55420  
    323323
    324324        // If no custom options for text are set, let's bail.
    325         if ( HEADER_TEXTCOLOR == $text_color ) {
     325        if ( HEADER_TEXTCOLOR === $text_color ) {
    326326            return;
    327327        }
     
    387387        <?php
    388388        // If the user has set a custom color for the text, use that.
    389         if ( get_header_textcolor() != HEADER_TEXTCOLOR ) :
     389        if ( get_header_textcolor() !== HEADER_TEXTCOLOR ) :
    390390            ?>
    391391    #site-title a,
     
    725725                    $avatar_size = 68;
    726726
    727                     if ( '0' != $comment->comment_parent ) {
     727                    if ( '0' !== $comment->comment_parent ) {
    728728                        $avatar_size = 39;
    729729                    }
     
    757757                    ?>
    758758
    759                     <?php if ( '0' == $comment->comment_approved ) : ?>
     759                    <?php if ( '0' === $comment->comment_approved ) : ?>
    760760                    <em class="comment-awaiting-moderation"><?php echo $moderation_note; ?></em>
    761761                    <br />
Note: See TracChangeset for help on using the changeset viewer.