Skip to content

Instantly share code, notes, and snippets.

@rafsuntaskin
Last active February 20, 2024 19:22
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 rafsuntaskin/6d197f7a56b5a4f37649a673b9ae9261 to your computer and use it in GitHub Desktop.
Save rafsuntaskin/6d197f7a56b5a4f37649a673b9ae9261 to your computer and use it in GitHub Desktop.
Avoid hiding unlisted events from ETP App
<?php
add_filter(
'tribe_events_archive_get_args',
function ( $args, $data, $request ) {
// If the API key is present that means the request is coming from App and we should not hide upcoming events.
if ( isset( $request['api_key'] ) ) {
$args['hide_upcoming'] = false;
// Include private events in the response.
$args['status'] = [ 'publish', 'private' ];
}
return $args;
},
10,
3
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment