Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- This snippet will serve as an additional example for creating conditional placeholder
- since we already have this conditional by default.
- */
- add_filter('em_events_get_default_search','my_em_get_default_search_has_spaces',1,2);
- function my_em_get_default_search_has_spaces($searches, $array){
- if( !empty($array['has_spaces']) && is_numeric($array['has_spaces']) ){
- $searches['has_spaces'] = $array['has_spaces'];
- }
- return $searches;
- }
- add_filter('em_events_get','my_em_events_get_has_spaces',1,2);
- function my_em_events_get_has_spaces($events, $args){
- if( !empty($args['has_spaces']) && is_numeric($args['has_spaces']) ){
- foreach($events as $event_key => $EM_Event){
- if( $EM_Event->event_rsvp && $EM_Event->get_bookings()->get_available_spaces() < 1 ){
- unset($events[$event_key]);
- }
- }
- }
- return $events;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement