WordPress.org

Make WordPress Core

Ticket #20628: 20628.2.alt.diff

File 20628.2.alt.diff, 690 bytes (added by SergeyBiryukov, 3 years ago)

Just check posts_per_page

  • wp-includes/query.php

     
    26262626                        return $r; 
    26272627                } 
    26282628 
    2629                 $split_the_query = apply_filters( 'split_the_query', ( $old_request == $this->request && "$wpdb->posts.*" == $fields && !empty( $limits) ), $this ); 
     2629                $split_the_query = ( $old_request == $this->request && "$wpdb->posts.*" == $fields && !empty( $limits ) && $q['posts_per_page'] < 500 ); 
     2630                $split_the_query = apply_filters( 'split_the_query', $split_the_query, $this ); 
    26302631 
    26312632                if ( $split_the_query ) { 
    26322633                        // First get the IDs and then fill in the objects