WordPress.org

Make WordPress Core

Ticket #18536: 18536.ref_array.patch

File 18536.ref_array.patch, 1.2 KB (added by scribu, 10 years ago)
  • wp-includes/query.php

    diff --git wp-includes/query.php wp-includes/query.php
    index 4174246..c621470 100644
    class WP_Query { 
    26092609                $this->request = $old_request = "SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
    26102610
    26112611                if ( !$q['suppress_filters'] ) {
    2612                         $this->request = apply_filters( 'posts_request', $this->request, $this );
     2612                        $this->request = apply_filters_ref_array( 'posts_request', array( $this->request, &$this ) );
    26132613                }
    26142614
    26152615                if ( 'ids' == $q['fields'] ) {
    class WP_Query { 
    27772777                if ( $q['no_found_rows'] || empty( $limits ) )
    27782778                        return;
    27792779
    2780                 $this->found_posts = $wpdb->get_var( apply_filters( 'found_posts_query', 'SELECT FOUND_ROWS()', $this ) );
    2781                 $this->found_posts = apply_filters( 'found_posts', $this->found_posts, $this );
     2780                $this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) );
     2781                $this->found_posts = apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) );
    27822782
    27832783                $this->max_num_pages = ceil( $this->found_posts / $q['posts_per_page'] );
    27842784        }