Add posts_where, the_posts, and query_string filters.
git-svn-id: https://develop.svn.wordpress.org/trunk@1443 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
68a0c70498
commit
ed96c5e8c9
@ -145,6 +145,8 @@ foreach (array_merge($wpvarstoreset, $more_wpvars) as $wpvar) {
|
||||
}
|
||||
}
|
||||
|
||||
$query_string = apply_filters('query_string', $query_string);
|
||||
|
||||
// Update some caches.
|
||||
update_category_cache();
|
||||
|
||||
|
@ -1686,6 +1686,8 @@ function query_posts($query) {
|
||||
$where .= " OR post_author = $user_ID AND post_status != 'draft')";
|
||||
else
|
||||
$where .= ')';
|
||||
|
||||
$where = apply_filters('posts_where', $where);
|
||||
$where .= " GROUP BY $wpdb->posts.ID";
|
||||
$request = " SELECT $distinct * FROM $wpdb->posts $join WHERE 1=1".$where." ORDER BY post_$orderby $limits";
|
||||
|
||||
@ -1702,6 +1704,8 @@ function query_posts($query) {
|
||||
// error_log("$request");
|
||||
// echo $request;
|
||||
$posts = $wpdb->get_results($request);
|
||||
$posts = apply_filters('the_posts', $posts);
|
||||
|
||||
update_post_caches($posts);
|
||||
return $posts;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user