mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
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:
parent
54ec3fd948
commit
b8f38cca10
@ -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