Skip to content

Instantly share code, notes, and snippets.

@ckpicker
Created June 6, 2014 14:19
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 ckpicker/cbc1bc4d798604d8eb77 to your computer and use it in GitHub Desktop.
Save ckpicker/cbc1bc4d798604d8eb77 to your computer and use it in GitHub Desktop.
Community Events 3.6 // Remove Selected Categories from Submission Form
add_filter( 'tribe_community_events_event_categories', 'remove_community_categories' );
function remove_community_categories( $cats ) {
//Category IDs to exclude
$excluded_cat_ids = array(4,12);
foreach ($cats as $key => $single_cat) {
//If item is found in array, then remove it
if( in_array( $single_cat->term_id, $excluded_cat_ids ) ) {
unset( $cats[$key] );
}
}
return $cats;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment