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.
Built from https://develop.svn.wordpress.org/trunk@59792


git-svn-id: http://core.svn.wordpress.org/trunk@59134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2025-02-09 18:51:21 +00:00
parent fdb545356c
commit 770eb818a4
2 changed files with 4 additions and 3 deletions

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 ) {

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.8-alpha-59791';
$wp_version = '6.8-alpha-59792';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.