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/twentynineteen/classes/class-twentynineteen-walker-comment.php

    r54885 r55420  
    3737                        $comment_author     = get_comment_author( $comment );
    3838                        $avatar             = get_avatar( $comment, $args['avatar_size'] );
    39                         if ( 0 != $args['avatar_size'] ) {
     39                        if ( 0 !== (int) $args['avatar_size'] ) {
    4040                            if ( empty( $comment_author_url ) ) {
    4141                                echo $avatar;
     
    9999                    ?>
    100100
    101                     <?php if ( '0' == $comment->comment_approved ) : ?>
     101                    <?php if ( '0' === $comment->comment_approved ) : ?>
    102102                    <p class="comment-awaiting-moderation"><?php echo $moderation_note; ?></p>
    103103                    <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.