Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function em_location_types_accepted_searches($searches)
- {
- $searches[] = 'location_type';
- return $searches;
- }
- add_filter('em_accepted_searches','em_location_types_accepted_searches',1,1);
- function em_location_types_get_default_search($searches, $array)
- {
- if( !empty($array['location_type'])){
- $searches['location_type'] = $array['location_type'];
- }
- return $searches;
- }
- add_filter('em_locations_get_default_search','em_location_types_get_default_search',1,2);
- function em_location_types_events_get($locations, $args)
- {
- if( !empty($args['location_type'])){
- $location_types = explode(',', $args['location_type']);
- foreach($locations as $location_key => $EM_Location){
- if( !in_array($EM_Location->location_attributes['location_type'], $location_types) ){
- unset($locations[$location_key]);
- }
- }
- }
- return $events;
- }
- add_filter('em_locations_get','em_location_types_events_get',1,2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement