WordPress.org

Make WordPress Core

Ticket #42860: 42860.patch

File 42860.patch, 531 bytes (added by janak007, 2 years ago)

Added array check and return the post counts

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

     
    31593159                        $this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) );
    31603160                } else {
    31613161                        $this->found_posts = count( $this->posts );
     3162                        $this->found_posts = is_array( $this->posts ) ? count( $this->posts ) : 0;
    31623163                }
    31633164
    31643165                /**