• I’m trying to use custom taxonomies to categorize my events and recurring events. I already have a plugin that detects events/recurring-events as Custom Post Types so they’re easy to assign. The metaboxes already show up on the Edit Event screen. The taxonomy information is saved along with the event/recurring event.
    However, I’d like to retrieve that taxonomy information and place it in a placeholder.

    Any ideas?

    Thank you!

    http://wordpress.org/extend/plugins/events-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
  • please try this post http://codex.wordpress.org/Function_Reference/get_post_types ? also, can you give more details on what taxonomy information you want to retrieved?

    Thread Starter Blackgossbo

    (@blackgossbo)

    I want to assign custom taxonomies to Events and Recurring Events and retrieve them as a placeholder.

    Thread Starter Blackgossbo

    (@blackgossbo)

    I figured it out. Thanks.

    function my_em_custom_placeholders($replace, $EM_Event, $result){
    	global $wp_query, $wp_rewrite;
    	switch( $result ){
    		case '#_CITY':
    			$replace = 'none';
    			$cities = get_the_terms($EM_Event->post_id, 'city');
    			if( is_array($cities) && count($cities) > 0 ){
    				$cities_list = array();
    				foreach($cities as $city){
    					$link = get_term_link($city->slug, 'city');
    					if ( is_wp_error($link) ) $link = '';
    					$cities_list[] = '<a href="'. $link .'">'. $city->name .'</a>';
    				}
    				$replace = implode(', ', $cities_list);
    			}
    
    			break;
    		case '#_LOCATION':
    			$replace = 'none';
    			$locations = get_the_terms($EM_Event->post_id, 'location');
    			if( is_array($locations) && count($locations) > 0 ){
    				$locations_list = array();
    				foreach($locations as $location){
    					$link = get_term_link($location->slug, 'location');
    					if ( is_wp_error($link) ) $link = '';
    					$locations_list[] = '<a href="'. $link .'">'. $location->name .'</a>';
    				}
    				$replace = implode(', ', $locations_list);
    			}
    
    			break;
    	}
    	return $replace;
    }
    add_filter('em_event_output_placeholder','my_em_custom_placeholders',1,3);

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Events Manager] Use Custom Taxonomies’ is closed to new replies.