WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/wp-includes/query.php

    r8795 r8559  
    776776            $qv['post_status'] = preg_replace('|[^a-z0-9_,-]|', '', $qv['post_status']);
    777777
    778         if ( $this->is_posts_page && ( ! isset($qv['withcomments']) || ! $qv['withcomments'] ) )
     778        if ( $this->is_posts_page && !$qv['withcomments'] )
    779779            $this->is_comment_feed = false;
    780780
     
    830830        $search = '';
    831831        $groupby = '';
    832         $fields = "$wpdb->posts.*";
    833832        $post_status_join = false;
    834         $page = 1;
    835 
    836         if ( !isset($q['suppress_filters']) )
    837             $q['suppress_filters'] = false;
    838833
    839834        if ( !isset($q['post_type']) ) {
     
    13671362        // Apply filters on where and join prior to paging so that any
    13681363        // manipulations to them are reflected in the paging by day queries.
    1369         if ( !$q['suppress_filters'] ) {
    1370             $where = apply_filters('posts_where', $where);
    1371             $join = apply_filters('posts_join', $join);
    1372         }
     1364        $where = apply_filters('posts_where', $where);
     1365        $join = apply_filters('posts_join', $join);
    13731366
    13741367        // Paging
     
    14021395            }
    14031396
    1404             if ( !$q['suppress_filters'] ) {
    1405                 $cjoin = apply_filters('comment_feed_join', $cjoin);
    1406                 $cwhere = apply_filters('comment_feed_where', $cwhere);
    1407                 $cgroupby = apply_filters('comment_feed_groupby', $cgroupby);
    1408             }
     1397            $cjoin = apply_filters('comment_feed_join', $cjoin);
     1398            $cwhere = apply_filters('comment_feed_where', $cwhere);
     1399            $cgroupby = apply_filters('comment_feed_groupby', $cgroupby);
    14091400
    14101401            $this->comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby ORDER BY comment_date_gmt DESC LIMIT " . get_option('posts_per_rss'));
     
    14241415        }
    14251416
    1426         $orderby = $q['orderby'];
    1427 
    14281417        // Apply post-paging filters on where and join.  Only plugins that
    14291418        // manipulate paging queries should use these hooks.
    1430         if ( !$q['suppress_filters'] ) {
    1431             $where = apply_filters('posts_where_paged', $where);
    1432             $groupby = apply_filters('posts_groupby', $groupby);
    1433             $join = apply_filters('posts_join_paged', $join);
    1434             $orderby = apply_filters('posts_orderby', $orderby);
    1435             $distinct = apply_filters('posts_distinct', $distinct);
    1436             $fields = apply_filters('posts_fields', $fields);
    1437             $limits = apply_filters( 'post_limits', $limits );
    1438         }
     1419
     1420        $where = apply_filters('posts_where_paged', $where);
     1421        $groupby = apply_filters('posts_groupby', $groupby);
     1422        $join = apply_filters('posts_join_paged', $join);
     1423        $orderby = apply_filters('posts_orderby', $q['orderby']);
     1424        $distinct = apply_filters('posts_distinct', $distinct);
     1425        $fields = apply_filters('posts_fields', "$wpdb->posts.*");
     1426        $limits = apply_filters( 'post_limits', $limits );
    14391427
    14401428        // Announce current selection parameters.  For use by caching plugins.
     
    14421430
    14431431        // Filter again for the benefit of caching plugins.  Regular plugins should use the hooks above.
    1444         if ( !$q['suppress_filters'] ) {
    1445             $where = apply_filters('posts_where_request', $where);
    1446             $groupby = apply_filters('posts_groupby_request', $groupby);
    1447             $join = apply_filters('posts_join_request', $join);
    1448             $orderby = apply_filters('posts_orderby_request', $orderby);
    1449             $distinct = apply_filters('posts_distinct_request', $distinct);
    1450             $fields = apply_filters('posts_fields_request', $fields);
    1451             $limits = apply_filters( 'post_limits_request', $limits );
    1452         }
     1432        $where = apply_filters('posts_where_request', $where);
     1433        $groupby = apply_filters('posts_groupby_request', $groupby);
     1434        $join = apply_filters('posts_join_request', $join);
     1435        $orderby = apply_filters('posts_orderby_request', $orderby);
     1436        $distinct = apply_filters('posts_distinct_request', $distinct);
     1437        $fields = apply_filters('posts_fields_request', $fields);
     1438        $limits = apply_filters( 'post_limits_request', $limits );
    14531439
    14541440        if ( ! empty($groupby) )
     
    14601446            $found_rows = 'SQL_CALC_FOUND_ROWS';
    14611447
    1462         $this->request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
    1463         if ( !$q['suppress_filters'] )
    1464             $this->request = apply_filters('posts_request', $this->request);
     1448        $request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
     1449        $this->request = apply_filters('posts_request', $request);
    14651450
    14661451        $this->posts = $wpdb->get_results($this->request);
    14671452        // Raw results filter.  Prior to status checks.
    1468         if ( !$q['suppress_filters'] )
    1469             $this->posts = apply_filters('posts_results', $this->posts);
     1453        $this->posts = apply_filters('posts_results', $this->posts);
    14701454
    14711455        if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) {
     
    15141498        }
    15151499
    1516         if ( !$q['suppress_filters'] )
    1517             $this->posts = apply_filters('the_posts', $this->posts);
     1500        $this->posts = apply_filters('the_posts', $this->posts);
    15181501
    15191502        update_post_caches($this->posts);
Note: See TracChangeset for help on using the changeset viewer.