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