WordPress.org

Support

Support » Plugins and Hacks » Events Manager » [Resolved] [Plugin: Events Manager] Shortcodes [locations_list]

[Resolved] [Plugin: Events Manager] Shortcodes [locations_list]

Viewing 1 replies (of 1 total)
  • you can do it by custom field using hooks/filters.

    e.g. pasting this to your theme functions.php (modify as needed) might work for you

    usage: [locations_list custom=”Concert Stage”]

    add_filter('em_locations_get_default_search','my_em_cf_get_default_search',1,2);
    function my_em_cf_get_default_search($searches, $array){
    	if( !empty($array['custom']) ){
    		$searches['custom'] = $array['custom'];
    	}
    	return $searches;
    }
    
    add_filter('em_locations_get','my_em_cf_events_get',1,2);
    function my_em_cf_events_get($locations, $args){
    	if( !empty($args['custom']) ){
    		foreach($locations as $location_key => $EM_Location){
    			if( !in_array($args['custom'],$EM_Location->location_attributes) ){
    				unset($locations[$location_key]);
    			}
    		}
    	}
    	return $locations;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: Events Manager] Shortcodes [locations_list]’ is closed to new replies.
Skip to toolbar