Add posts_where, the_posts, and query_string filters.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rboren 2004-06-20 22:36:45 +00:00
parent 54ec3fd948
commit b8f38cca10
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;
}