Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When sc_events_list is set to show a category but no events are in that category, all events are shown #256

Open
JiveDig opened this issue Apr 28, 2022 · 1 comment

Comments

@JiveDig
Copy link

JiveDig commented Apr 28, 2022

Using the release/2.3.0 branch but it may happen with master too?

I have [sc_events_list category="webinars-featured" display="upcoming" number="200"] on a page. There are currently NO upcoming events in "Webinars Featured" calendar category but it's showing all 4 past events. Without digging, it appears that instead of returning/bailing when conditions aren't met it's showing all.

@JiveDig
Copy link
Author

JiveDig commented Jul 15, 2022

Just putting a note that WP_Query's post__in and WP_Term_Query's include have both given me issues when they are 0 or an empty array array() and return results when there shouldn't be any.

The only thing I've found that works is returning [-1].

Something like this:

$query_args['include'] = isset( $atts['include'] ) && ! empty( $atts['include'] ) ?  $atts['include'] : [-1];

Not sure if that's related here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant