Need to filter posts before post_type and user checks
|Reported by:||ev3rywh3re||Owned by:||anonymous|
|Severity:||normal||Keywords:||filter the_posts has-patch|
I'm working on making EventCalendar3 work with 2.1Alpha. It actually works well using standard filters while preserving the status = future with one exception.
Once you actually send the sql request with WP_Query, it goes through another check for status = future. This is around line 886 in query.php. I thought this may be a good place to add a filter like "posts_result". A filter can then be run on the results before the posts get the status check then filter "the_posts". I'm just going to paste a sample for query.php:
$this->request = apply_filters('posts_request', $request); $this->posts = $wpdb->get_results($this->request); $this->posts = apply_filters('posts_results', $this->posts); // Check post status to determine if post should be displayed.
The only alternative is to publish those posts which is probably not really the correct since they should probably still be "future" posts until the proper date.
Change History (6)
- Keywords has-patch added; posts hook removed
- Summary changed from Need filter for posts after get results and before post status check to Need to filter posts before post_type and user checks