Skip to content

Commit 3205934

Browse files
Coding Standards: Use strict comparison in WP_Query::the_post() and ::have_posts().
Follow-up to [2716], [2741], [11464]. Props aristath, poena, afercia, SergeyBiryukov. See #62279. git-svn-id: https://develop.svn.wordpress.org/trunk@59792 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 07034aa commit 3205934

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3752,7 +3752,7 @@ public function the_post() {
37523752
$this->in_the_loop = true;
37533753
$this->before_loop = false;
37543754

3755-
if ( -1 == $this->current_post ) { // Loop has just started.
3755+
if ( -1 === $this->current_post ) { // Loop has just started.
37563756
/**
37573757
* Fires once the loop is started.
37583758
*
@@ -3779,7 +3779,7 @@ public function the_post() {
37793779
public function have_posts() {
37803780
if ( $this->current_post + 1 < $this->post_count ) {
37813781
return true;
3782-
} elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) {
3782+
} elseif ( $this->current_post + 1 === $this->post_count && $this->post_count > 0 ) {
37833783
/**
37843784
* Fires once the loop has ended.
37853785
*
@@ -3788,6 +3788,7 @@ public function have_posts() {
37883788
* @param WP_Query $query The WP_Query instance (passed by reference).
37893789
*/
37903790
do_action_ref_array( 'loop_end', array( &$this ) );
3791+
37913792
// Do some cleaning up after the loop.
37923793
$this->rewind_posts();
37933794
} elseif ( 0 === $this->post_count ) {

0 commit comments

Comments
 (0)