PluginProbe
Event Post / 5.6.1
Event Post v5.6.1
6.1.1 6.1.0 6.0.1 6.0.0 5.12.0 trunk 3.9 4.0 4.2 4.3 4.4 4.5 5.0 5.1 5.10.0 5.10.1 5.10.2 5.10.3 5.10.4 5.11.0 5.11.1 5.2 5.5 5.6 5.6.1 All 46 releases
event-post / inc / wrappers.php

wrappers.php in Event Post 5.6.1, at inc/wrappers.php

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