1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136:
<?php
/**
* Shortcuts for useful functions in templates
*
* @package event-post
* @version 5.9.7
* @since 5.0.0
*/
if(!function_exists('get_the_dates')){
/**
* Returns the HTML string of the given event's date range.
* If no post reference is given, the current post will be used
*
* @param mixte $post
*
* @global \EventPost $EventPost
*
* @return string
*
* @example:
* <pre>
* <div class="event_date" data-start="april 6 2017 12am" data-end="april 6 2017 1pm">
* <time itemprop="dtstart" datetime="2017-04-06T12:08:00+00:00">
* <span class="date date-single">april 6 2017, 8am</span>
* <span class="linking_word linking_word-from">from</span>
* <span class="time time-start">12h am</span>
* <span class="linking_word linking_word-to">to</span>
* <span class="time time-end">1h am</span>
* </time>
* </div>
* </pre>
*/
function get_the_dates($_post=null){
global $EventPost, $post;
if(!$_post){
$_post = $post;
}
return $EventPost->print_date($_post);
}
}
if(!function_exists('the_dates')){
/**
* Outputs the HTML generated by `get_the_dates`
*
* @param mixte $post
*/
function the_dates($post=null){
echo get_the_dates($post);
}
}
if(!function_exists('get_the_date_start')){
/**
* Returns the HTML of the start date of an event
*
* @param type $post
*
* @global \EventPost $EventPost
*
* @return string
*/
function get_the_date_start($post=null){
global $EventPost;
$event = $EventPost->retreive($post);
return $EventPost->human_date($event->time_start, $EventPost->settings['dateformat']);
}
}
if(!function_exists('the_date_start')){
/**
* Outputs the HTML of the start date of an event
*
* @param type $post
*/
function the_date_start($post=null){
echo get_the_date_start($post);
}
}
if(!function_exists('get_the_date_end')){
/**
* Returns the HTML of the end date of an event
*
* @param type $post
*
* @global \EventPost $EventPost
*
* @return string
*/
function get_the_date_end($post=null){
global $EventPost;
$event = $EventPost->retreive($post);
return $EventPost->human_date($event->time_end, $EventPost->settings['dateformat']);
}
}
if(!function_exists('the_date_end')){
/**
* Outputs the HTML of the start date of an event
*
* @param type $post
*
* @global \EventPost $EventPost
*
* @return string
*/
function the_date_end($post=null){
echo get_the_date_end($post);
}
}
if(!function_exists('get_the_location')){
/**
* Returns the HTML of the location date of an event
*
* @param type $post
*
* @global \EventPost $EventPost
*
* @return string
*/
function get_the_location($post=null){
global $EventPost;
return $EventPost->print_location($post);
}
}
if(!function_exists('the_location')){
/**
* Outputs the HTML of the location date of an event
*
* @param type $post
*/
function the_location($post=null){
echo get_the_location($post);
}
}