Hi,
I’m using the event_search shortcode in a template like this:
echo do_shortcode('[event_search filters="event_category,date"]');
However the results are showing pending_review and drafts posts which shouldn’t be the case. I’m using the FES add-on to allow submission of events which are being set to pending_review automatically. These posts shouldn’t come up in the post listing until they’re published.
If I echo out the sql generated by $eo_event_loop = new WP_Query( $query ); on line 412 of shortcodes.php it looks like this:
SELECT SQL_CALC_FOUND_ROWS wp_posts.*,
wp_eo_events.event_id,
wp_eo_events.event_id AS occurrence_id,
wp_eo_events.StartDate,
wp_eo_events.StartTime,
wp_eo_events.EndDate,
wp_eo_events.FinishTime,
wp_eo_events.event_occurrence
FROM wp_posts
LEFT JOIN wp_eo_events ON wp_posts.id = wp_eo_events.post_id
WHERE 1=1
AND wp_posts.post_type = 'event'
AND ((wp_posts.post_status <> 'trash' AND wp_posts.post_status <> 'auto-draft' AND wp_posts.post_status <> 'expired'))
AND (wp_eo_events.EndDate > '2015-04-06' OR (wp_eo_events.EndDate = '2015-04-06' AND wp_eo_events.FinishTime > '12:32:32'))
ORDER BY wp_eo_events.StartDate ASC, wp_eo_events.StartTime ASC
LIMIT 0, 10;
It seems to only be filtering out trash, auto-draft and expired. How can I ensure that this shortcode only returns published posts?
Thanks.

VERB Interactive
Mmm… I’m not seeing this. Here’s what I get:
AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'confirmed' OR wp_posts.post_status = 'active' OR wp_posts.post_status = 'private')
(As viewed by an admin, who can read private events – logged out users can’t see that).
The status is not explicitly set, so it would perhaps be prudent to set it. E.g. adding
'post_status' => get_post_stati( array('public' => true) ),
to the $query
. I’ll be doing this in the next update.

Stephen Harris
Hi Stephen,
Turns out there was an issue with a custom plugin we’d built for the site that was interfering.
Thanks for your quick reply!

VERB Interactive
I never updated, this thread, but this bug was fixed in 1.10.3

Stephen Harris