Advertisement
supportnwl

#_LOCATIONNEXTEVENTS override

Aug 27th, 2012
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. add_filter('em_location_output_placeholder','my_em_placeholder_mod',1,3);
  2. function my_em_placeholder_mod($replace, $EM_Location, $result){
  3. switch( $result ){
  4. case '#_LOCATIONNEXTEVENTS':
  5. $events = EM_Events::get( array('location'=>$EM_Location->location_id, 'scope'=>'future', 'limit'=>3) );
  6. if ( count($events) > 0 ){
  7. $replace = get_option('dbem_location_event_list_item_header_format');
  8. foreach($events as $event){
  9. $replace .= $event->output(get_option('dbem_location_event_list_item_format'));
  10. }
  11. $replace .= get_option('dbem_location_event_list_item_footer_format');
  12. } else {
  13. $replace = get_option('dbem_location_no_events_message');
  14. }
  15. break;
  16. }
  17. return $replace;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement