Ticket #21276: 21276.diff
File 21276.diff, 2.1 KB (added by , 13 years ago) |
---|
-
wp-includes/query.php
2201 2201 } 2202 2202 2203 2203 // Allow plugins to contextually add/remove/modify the search section of the database query 2204 $search = apply_filters_ref_array('posts_search', array( $search, &$this ) ); 2204 if ( !$q['suppress_filters'] ) 2205 $search = apply_filters_ref_array('posts_search', array( $search, &$this ) ); 2206 2205 2207 2206 2208 // Taxonomies 2207 2209 if ( !$this->is_singular ) { … … 2609 2611 2610 2612 $this->request = $old_request = "SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits"; 2611 2613 2612 if ( !$q['suppress_filters'] ) {2614 if ( !$q['suppress_filters'] ) 2613 2615 $this->request = apply_filters_ref_array( 'posts_request', array( $this->request, &$this ) ); 2614 }2615 2616 2616 2617 if ( 'ids' == $q['fields'] ) { 2617 2618 $this->posts = $wpdb->get_col($this->request); … … 2630 2631 } 2631 2632 2632 2633 $split_the_query = ( $old_request == $this->request && "$wpdb->posts.*" == $fields && !empty( $limits ) && $q['posts_per_page'] < 500 ); 2633 $split_the_query = apply_filters( 'split_the_query', $split_the_query, $this ); 2634 if ( !$q['suppress_filters'] ) 2635 $split_the_query = apply_filters( 'split_the_query', $split_the_query, $this ); 2636 2634 2637 2635 2638 if ( $split_the_query ) { 2636 2639 // First get the IDs and then fill in the objects 2637 2640 2638 2641 $this->request = "SELECT $found_rows $distinct $wpdb->posts.ID FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits"; 2639 2642 2640 $this->request = apply_filters( 'posts_request_ids', $this->request, $this ); 2643 if ( !$q['suppress_filters'] ) 2644 $this->request = apply_filters( 'posts_request_ids', $this->request, $this ); 2641 2645 2642 2646 $ids = $wpdb->get_col( $this->request ); 2643 2647 … … 2701 2705 } 2702 2706 } 2703 2707 2704 if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) )2708 if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) && !$q['suppress_filters'] ) 2705 2709 $this->posts[0] = apply_filters_ref_array('the_preview', array( $this->posts[0], &$this )); 2706 2710 } 2707 2711