Skip to content

Instantly share code, notes, and snippets.

@ckpicker
Created March 4, 2014 15:37
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/9348720 to your computer and use it in GitHub Desktop.
Save ckpicker/9348720 to your computer and use it in GitHub Desktop.
Community Events 3.4 // Display Category Descriptions on Submission Form
add_filter('tribe_events_community_before_the_categories','my_category_descriptions');
function my_category_descriptions() {
echo '<div class="tribe-events-community-details eventForm bubble tribe-events-community-category-descriptions">';
//Get all categories
$event_cats = get_terms('tribe_events_cat');
if(!empty($event_cats)) {
remove_filter('term_description','wpautop');
//Loop through Event Categories and display description
echo '<ul>';
foreach($event_cats as $event_cat) {
$cat_description = term_description( $event_cat->term_id, 'tribe_events_cat' );
if(!empty($cat_description))
echo '<li>' . $event_cat->name . ': ' . $cat_description . '</li>';
}
add_filter('term_description','wpautop');
echo '</ul>';
}
echo '</div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment