Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Last active July 15, 2016 11:58
Show Gist options
  • Save Pebblo/4cf4b8efb25ada0187954c4d0e5d4a95 to your computer and use it in GitHub Desktop.
Save Pebblo/4cf4b8efb25ada0187954c4d0e5d4a95 to your computer and use it in GitHub Desktop.
An example of pulling all of the datetimes for the event object from the current post ID
<?php
$datetimes = EEM_Datetime::instance()->get_datetimes_for_event_ordered_by_start_time( $post->ID, $include_expired = true, $include_deleted= true );
foreach ($datetimes as $datetime) {
echo date_i18n( $date_format, strtotime( $datetime->start_date_and_time('Y-m-d', 'H:i:s') ) );
echo '<br/>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment