WordPress.org

Make WordPress Core

Ticket #41446: 41446.patch

File 41446.patch, 478 bytes (added by umangvaghela123, 4 years ago)

It is fine if we use this solution for overcome the chance of error.

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

     
    32063206         */
    32073207        public function rewind_posts() {
    32083208                $this->current_post = -1;
    3209                 if ( $this->post_count > 0 ) {
     3209                if ( !empty( $this->post_count )  && isset( $this->posts[0] ) && $this->post_count > 0 ) {
    32103210                        $this->post = $this->posts[0];
    32113211                }
    32123212        }