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/twentytwenty/comments.php

    r47941 r55420  
    2424
    2525        <?php
    26         $comments_number = absint( get_comments_number() );
     26        $comments_number = get_comments_number();
    2727        ?>
    2828
     
    3333            if ( ! have_comments() ) {
    3434                _e( 'Leave a comment', 'twentytwenty' );
    35             } elseif ( 1 === $comments_number ) {
     35            } elseif ( '1' === $comments_number ) {
    3636                /* translators: %s: Post title. */
    3737                printf( _x( 'One reply on &ldquo;%s&rdquo;', 'comments title', 'twentytwenty' ), get_the_title() );
Note: See TracChangeset for help on using the changeset viewer.