Skip to content

Instantly share code, notes, and snippets.

@sidharrell
Created February 10, 2014 22:13
Show Gist options
  • Save sidharrell/8925324 to your computer and use it in GitHub Desktop.
Save sidharrell/8925324 to your computer and use it in GitHub Desktop.
function to return display of all event times
function espresso_display_all_event_times($event_id) {
global $wpdb;
$sql = "SELECT ese.start_time, ese.end_time ";
$sql .= "FROM " . EVENTS_START_END_TABLE . " ese WHERE ese.event_id = %d";
$times = $wpdb->get_results($wpdb->prepare($sql, $event_id));
if(empty($times)) return NULL;
$time_format = get_option('time_format');
$output = "<p>";
foreach ($times as $time) {
$output .= "<span>" . event_date_display($time->start_time, $time_format) . " - " . event_date_display($time->end_time, $time_format) . "</span>";
}
$output .= "</p>";
return $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment