PluginProbe
Event Post / 5.2
Event Post v5.2
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.2, at inc/wrappers.php

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