Show custom taxonomy ‘Band’ in frontend – Events Manager
-
I’m using a custom taxonomy ‘Bands’ with Events Manager.
As mentioned in the tutorial (https://wp-events-plugin.com/tutorials/using-additional-custom-taxonomies/) I used:
function my_em_own_taxonomy_register(){ register_taxonomy_for_object_type('bands',EM_POST_TYPE_EVENT); register_taxonomy_for_object_type('bands',EM_POST_TYPE_LOCATION); register_taxonomy_for_object_type('bands','event-recurring'); } add_action('init','my_em_own_taxonomy_register',100);
I want to use the placeholder #_BANDS to show which bands are playing at an event.
This tutorial (https://wp-events-plugin.com/tutorials/create-a-custom-placeholder-for-event-formatting/) shows how to make a custom placeholder.
But, how do I get the custom taxonomy out of the EM_EVENT object? Displaying $EM_Event doesn’t show any ‘bands’ taxonomy.
This is the example, here the taxonomy ‘STYLES’ is used:
add_filter('em_event_output_placeholder','my_em_styles_placeholders',1,3); function my_em_styles_placeholders($replace, $EM_Event, $result){ if( $result == '#_STYLES' ){ $replace = 'none'; if( count($EM_Event->styles) > 0 ){ $my_em_styles = (is_array(get_option('my_em_styles'))) ? get_option('my_em_styles'):array(); $styles = array(); foreach( $EM_Event->styles as $id ){ if( !empty($my_em_styles[$id]) ){ $styles[] = $my_em_styles[$id]; } } $replace = implode(', ', $styles); } } return $replace; }
Am I missing something? ??
I’m using version 5.9.5 of the Event Manager with WordPress 4.9.8
- The topic ‘Show custom taxonomy ‘Band’ in frontend – Events Manager’ is closed to new replies.