Make WordPress Core

Changeset 59498


Ignore:
Timestamp:
12/08/2024 11:42:00 PM (2 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-includes/comment-template.php.

Follow-up to [162], [2685], [4494], [8878], [8961], [55660].

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

File:
1 edited

Legend:

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

    r59183 r59498  
    962962 */
    963963function get_comments_number_text( $zero = false, $one = false, $more = false, $post = 0 ) {
    964     $comments_number = get_comments_number( $post );
     964    $comments_number = (int) get_comments_number( $post );
    965965
    966966    if ( $comments_number > 1 ) {
     
    997997            $comments_number_text = str_replace( '%', number_format_i18n( $comments_number ), $more );
    998998        }
    999     } elseif ( 0 == $comments_number ) {
     999    } elseif ( 0 === $comments_number ) {
    10001000        $comments_number_text = ( false === $zero ) ? __( 'No Comments' ) : $zero;
    10011001    } else { // Must be one.
     
    16491649    $post_id         = get_the_ID();
    16501650    $post_title      = get_the_title();
    1651     $comments_number = get_comments_number( $post_id );
     1651    $comments_number = (int) get_comments_number( $post_id );
    16521652
    16531653    if ( false === $zero ) {
     
    16761676    }
    16771677
    1678     if ( 0 == $comments_number && ! comments_open() && ! pings_open() ) {
     1678    if ( 0 === $comments_number && ! comments_open() && ! pings_open() ) {
    16791679        printf(
    16801680            '<span%1$s>%2$s</span>',
     
    16901690    }
    16911691
    1692     if ( 0 == $comments_number ) {
     1692    if ( 0 === $comments_number ) {
    16931693        $respond_link = get_permalink() . '#respond';
    16941694        /**
     
    17741774    $args = wp_parse_args( $args, $defaults );
    17751775
    1776     if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] ) {
     1776    $args['max_depth'] = (int) $args['max_depth'];
     1777    $args['depth']     = (int) $args['depth'];
     1778
     1779    if ( 0 === $args['depth'] || $args['max_depth'] <= $args['depth'] ) {
    17771780        return;
    17781781    }
Note: See TracChangeset for help on using the changeset viewer.