Skip to content

Instantly share code, notes, and snippets.

@reformatco
Created September 29, 2023 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reformatco/e796c0fc86ce93d834ea9e28ef89420c to your computer and use it in GitHub Desktop.
Save reformatco/e796c0fc86ce93d834ea9e28ef89420c to your computer and use it in GitHub Desktop.
Allow past events custom query with The Events Calendar
// You can save original $wp_filter
remove_action('parse_query', 'Tribe__Events__Query::parse_query', 50);
remove_action('parse_query', 'Tribe__Events__Query::filter_and_order_by_date', 1000);
// Run your query
$query = new WP Query()
// Reinstate the parse_query filters here in case you need it later on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment