Make WordPress Core

Changeset 59976


Ignore:
Timestamp:
03/12/2025 08:10:29 PM (20 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in WP_Query::get_posts(), take 1.

Follow-up to [4112], [17552], [19918], [20740], [56513], [56656].

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-query.php

    r59937 r59976  
    19321932                // Set a flag if a 'pre_get_posts' hook changed the query vars.
    19331933                $hash = md5( serialize( $this->query_vars ) );
    1934                 if ( $hash != $this->query_vars_hash ) {
     1934                if ( $hash !== $this->query_vars_hash ) {
    19351935                        $this->query_vars_changed = true;
    19361936                        $this->query_vars_hash    = $hash;
    … …  
    20322032                        $q['nopaging'] = false;
    20332033                }
     2034
    20342035                $q['posts_per_page'] = (int) $q['posts_per_page'];
    20352036                if ( $q['posts_per_page'] < -1 ) {
    20362037                        $q['posts_per_page'] = abs( $q['posts_per_page'] );
    2037                 } elseif ( 0 == $q['posts_per_page'] ) {
     2038                } elseif ( 0 === $q['posts_per_page'] ) {
    20382039                        $q['posts_per_page'] = 1;
    20392040                }
    … …  
    33473348                }
    33483349
    3349                 $is_unfiltered_query = $old_request == $this->request && "{$wpdb->posts}.*" === $fields;
     3350                $is_unfiltered_query = $old_request === $this->request && "{$wpdb->posts}.*" === $fields;
    33503351
    33513352                if ( null === $this->posts ) {
Note: See TracChangeset for help on using the changeset viewer.