Skip to content

Instantly share code, notes, and snippets.

@sidharrell
Created October 17, 2013 17:47
Show Gist options
  • Save sidharrell/7029235 to your computer and use it in GitHub Desktop.
Save sidharrell/7029235 to your computer and use it in GitHub Desktop.
get event dates and times
<?php
function get_event_date_times($event_id = FALSE, $format = ARRAY_A) {
global $wpdb;
$sql = "SELECT e.start_date, e.end_date, ese.start_time, ese.end_time ";
$sql .= "FROM " . EVENTS_DETAIL_TABLE . " e ";
$sql .= "LEFT JOIN " . EVENTS_START_END_TABLE . " ese ON ese.event_id = e.id ";
$sql .= "WHERE e.id = %d";
$results = $wpdb->get_results($wpdb->prepare($sql, $event_id), $format);
return $results;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment