eo_get_the_occurrences_of
since 1.5
eo_get_the_occurrences_of( $post_id )
Returns an array of occurrences. Each occurrence is an array with 'start' and 'end' key.
Both of these hold a DateTime object (for the start and end of that occurrence respecitvely).
Example
List the start and end dates of a particular event.
$occurrences = eo_get_the_occurrences_of( $post_id );
echo '<ul>';
foreach( $occurrences as $occurrence) {
$start = eo_format_datetime( $occurrence['start'] , 'jS F ga' );
$end = eo_format_datetime( $occurrence['end'] , 'jS F ga' );
printf( '<li> This event starts on the %s and ends on the %s </li>', $start, $end );
echo eo_format_datetime($include_date['start'],'c');
}
echo '</ul>';
Parameters
int
|
$post_id |
The event (post) ID. Uses current event if empty.
|
Return value
array
|
Array of arrays of DateTime objects of the start and end date-times of occurrences. False if none exist.
|
Hooks
Changelog