Created
June 6, 2014 14:19
-
-
Save ckpicker/cbc1bc4d798604d8eb77 to your computer and use it in GitHub Desktop.
Community Events 3.6 // Remove Selected Categories from Submission Form
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
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