WordPress.org

Make WordPress Core

Ticket #42256: 42256.diff

File 42256.diff, 786 bytes (added by ethitter, 21 months ago)
  • src/wp-includes/class-wp-query.php

     
    19171917                } elseif ( $q['post__in'] ) {
    19181918                        $post__in = implode(',', array_map( 'absint', $q['post__in'] ));
    19191919                        $where .= " AND {$wpdb->posts}.ID IN ($post__in)";
     1920
     1921                        // Don't count found rows when a specific range is requested.
     1922                        if ( isset( $q['posts_per_page'] ) && count( $q['post__in'] ) === (int) $q['posts_per_page'] ) {
     1923                                $q['no_found_rows'] = true;
     1924                        }
    19201925                } elseif ( $q['post__not_in'] ) {
    19211926                        $post__not_in = implode(',',  array_map( 'absint', $q['post__not_in'] ));
    19221927                        $where .= " AND {$wpdb->posts}.ID NOT IN ($post__not_in)";