# event-post/5.10.2/inc/wrappers.php

Event Post, version 5.10.2. 136 lines.

- Page: https://pluginprobe.com/plugins/event-post/5.10.2/code/inc/wrappers.php
- Raw: https://pluginprobe.com/plugins/event-post/5.10.2/raw/inc/wrappers.php
- Modified: 2025-05-21T10:43:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/event-post/5.10.2/code/inc/wrappers.php#L10-L20`.

```php
<?php
/**
 * Shortcuts for useful functions in templates
 * 
 * @package event-post
 * @version 5.10.2
 * @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);
    }
}

```
