diff --git a/wp-blog-header.php b/wp-blog-header.php index c700942cce..18f80f02d1 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -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(); diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 14201af249..ac2a96aa33 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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; }