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
This commit is contained in:
Sergey Biryukov 2025-02-09 18:49:51 +00:00
parent 07034aa7b7
commit 32059347a3

View File

@ -3752,7 +3752,7 @@ class WP_Query {
$this->in_the_loop = true;
$this->before_loop = false;
if ( -1 == $this->current_post ) { // Loop has just started.
if ( -1 === $this->current_post ) { // Loop has just started.
/**
* Fires once the loop is started.
*
@ -3779,7 +3779,7 @@ class WP_Query {
public function have_posts() {
if ( $this->current_post + 1 < $this->post_count ) {
return true;
} elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) {
} elseif ( $this->current_post + 1 === $this->post_count && $this->post_count > 0 ) {
/**
* Fires once the loop has ended.
*
@ -3788,6 +3788,7 @@ class WP_Query {
* @param WP_Query $query The WP_Query instance (passed by reference).
*/
do_action_ref_array( 'loop_end', array( &$this ) );
// Do some cleaning up after the loop.
$this->rewind_posts();
} elseif ( 0 === $this->post_count ) {