Skip to content

Commit d71d317

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@59976 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 7475126 commit d71d317

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/wp-includes/class-wp-query.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,7 @@ public function get_posts() {
19311931

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;
19371937
}
@@ -2031,10 +2031,11 @@ public function get_posts() {
20312031
}
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
}
20402041

@@ -3346,7 +3347,7 @@ public function get_posts() {
33463347
return $post_parents;
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 ) {
33523353
$split_the_query = (

0 commit comments

Comments
 (0)