Last active
February 20, 2024 19:22
-
-
Save rafsuntaskin/6d197f7a56b5a4f37649a673b9ae9261 to your computer and use it in GitHub Desktop.
Avoid hiding unlisted events from ETP App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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