Created
February 10, 2014 22:13
-
-
Save sidharrell/8925324 to your computer and use it in GitHub Desktop.
function to return display of all event times
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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