WordPress.org

Make WordPress Core

Changeset 2000


Ignore:
Timestamp:
12/25/2004 12:32:50 AM (16 years ago)
Author:
rboren
Message:

Add post_where_paged and post_join_paged filter hooks. Move posts_where and posts_join before the paging queries.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r1986 r2000  
    480480            $where .= ')';
    481481
     482        // Apply filters on where and join prior to paging so that any
     483        // manipulations to them are reflected in the paging by day queries.
     484        $where = apply_filters('posts_where', $where);
     485        $join = apply_filters('posts_join', $join);
     486
    482487        // Paging
    483488        if ( !empty($q['postend']) && ($q['postend'] > $q['poststart']) ) {
     
    522527        }
    523528
    524         $where = apply_filters('posts_where', $where);
     529        // Apply post-paging filters on where and join.  Only plugins that
     530        // manipulate paging queries should use these hooks.
     531        $where = apply_filters('posts_where_paged', $where);
    525532        $where .= " GROUP BY $wpdb->posts.ID";
    526         $join = apply_filters('posts_join', $join);
     533        $join = apply_filters('posts_join_paged', $join);
    527534        $request = " SELECT $distinct * FROM $wpdb->posts $join WHERE 1=1".$where." ORDER BY post_" . $q['orderby'] . " $limits";
    528535
Note: See TracChangeset for help on using the changeset viewer.