Last active
April 6, 2023 15:36
-
-
Save cliffordp/a521d02facbc64ce3891c9341384cc07 to your computer and use it in GitHub Desktop.
The Events Calendar: Remove the Organizers post type from Events
This file contains 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 | |
/** | |
* The Events Calendar: Remove the Organizers post type from Events. | |
* | |
* Replace instances of ORGANIZER_POST_TYPE with VENUE_POST_TYPE if you | |
* want to do so for Venues instead. | |
* | |
* @link https://theeventscalendar.com/knowledgebase/linked-post-types/ | |
* @link https://gist.github.com/a521d02facbc64ce3891c9341384cc07 | |
*/ | |
function tribe_remove_organizers_from_events( $default_types ) { | |
if ( | |
! is_array( $default_types ) | |
|| empty( $default_types ) | |
|| empty( Tribe__Events__Main::ORGANIZER_POST_TYPE ) | |
) { | |
return $default_types; | |
} | |
if ( ( $key = array_search( Tribe__Events__Main::ORGANIZER_POST_TYPE, $default_types ) ) !== false ) { | |
unset( $default_types[ $key ] ); | |
} | |
return $default_types; | |
} | |
add_filter( 'tribe_events_register_default_linked_post_types', 'tribe_remove_organizers_from_events' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@gavin310 glad to know! 🥳