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:
Ryan Boren 2004-06-20 22:36:45 +00:00
parent 68a0c70498
commit ed96c5e8c9
2 changed files with 6 additions and 0 deletions

View File

@ -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();

View File

@ -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;
}