Make WordPress Core

Ticket #42860: 42860-1.2.patch

File 42860-1.2.patch, 539 bytes (added by janak007, 7 years ago)

Added array check and return the post counts

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

     
    31583158                         */
    31593159                        $this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) );
    31603160                } else {
    3161                         $this->found_posts = count( $this->posts );
     3161                        $this->found_posts = is_array( $this->posts ) ? count( $this->posts ) : 0;
    31623162                }
    31633163
    31643164                /**