Created
March 4, 2014 15:37
-
-
Save ckpicker/9348720 to your computer and use it in GitHub Desktop.
Community Events 3.4 // Display Category Descriptions on 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_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