add_filter('em_location_output_placeholder','my_em_placeholder_mod',1,3); function my_em_placeholder_mod($replace, $EM_Location, $result){ switch( $result ){ case '#_LOCATIONNEXTEVENTS': $events = EM_Events::get( array('location'=>$EM_Location->location_id, 'scope'=>'future', 'limit'=>3) ); if ( count($events) > 0 ){ $replace = get_option('dbem_location_event_list_item_header_format'); foreach($events as $event){ $replace .= $event->output(get_option('dbem_location_event_list_item_format')); } $replace .= get_option('dbem_location_event_list_item_footer_format'); } else { $replace = get_option('dbem_location_no_events_message'); } break; } return $replace; }