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 +37 -22 5.6 → 6.1.2 View file →
@@ -1,32 +1,38 @@
1 1 <?php
2 2 /**
3 - *
3 + * Shortcuts for useful functions in templates
4 + *
4 5 * @package event-post
6 + * @version 6.1.2
7 + * @since 5.0.0
5 8 */
6 9
10 + if ( ! defined( 'ABSPATH' ) ) exit;
11 +
7 12 if(!function_exists('get_the_dates')){
8 13 /**
9 14 * Returns the HTML string of the given event's date range.
10 15 * If no post reference is given, the current post will be used
11 16 *
17 + * @param mixte $post
18 + *
12 19 * @global \EventPost $EventPost
13 - * @param mixte $post
20 + *
14 21 * @return string
15 22 *
16 - * example:
23 + * @example:
17 24 * <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 - *
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>
34 + * </pre>
29 35 */
30 36 function get_the_dates($_post=null){
31 37 global $EventPost, $post;
32 38 if(!$_post){
@@ -37,12 +43,13 @@
37 43 }
38 44 if(!function_exists('the_dates')){
39 45 /**
40 46 * Outputs the HTML generated by `get_the_dates`
47 + *
41 48 * @param mixte $post
42 49 */
43 50 function the_dates($post=null){
44 - echo get_the_dates($post);
51 + echo wp_kses(get_the_dates($post), EventPost()->kses_tags);
45 52 }
46 53 }
47 54
48 55 if(!function_exists('get_the_date_start')){
@@ -48,10 +55,12 @@
48 55 if(!function_exists('get_the_date_start')){
49 56 /**
50 57 * Returns the HTML of the start date of an event
51 58 *
59 + * @param type $post
60 + *
52 61 * @global \EventPost $EventPost
53 - * @param type $post
62 + *
54 63 * @return string
55 64 */
56 65 function get_the_date_start($post=null){
57 66 global $EventPost;
@@ -65,9 +74,9 @@
65 74 *
66 75 * @param type $post
67 76 */
68 77 function the_date_start($post=null){
69 - echo get_the_date_start($post);
78 + echo wp_kses(get_the_date_start($post), EventPost()->kses_tags);
70 79 }
71 80 }
72 81
73 82 if(!function_exists('get_the_date_end')){
@@ -73,10 +82,12 @@
73 82 if(!function_exists('get_the_date_end')){
74 83 /**
75 84 * Returns the HTML of the end date of an event
76 85 *
86 + * @param type $post
87 + *
77 88 * @global \EventPost $EventPost
78 - * @param type $post
89 + *
79 90 * @return string
80 91 */
81 92 function get_the_date_end($post=null){
82 93 global $EventPost;
@@ -87,14 +98,16 @@
87 98 if(!function_exists('the_date_end')){
88 99 /**
89 100 * Outputs the HTML of the start date of an event
90 101 *
102 + * @param type $post
103 + *
91 104 * @global \EventPost $EventPost
92 - * @param type $post
105 + *
93 106 * @return string
94 107 */
95 108 function the_date_end($post=null){
96 - echo get_the_date_end($post);
109 + echo wp_kses(get_the_date_end($post), EventPost()->kses_tags);
97 110 }
98 111 }
99 112
100 113 if(!function_exists('get_the_location')){
@@ -100,10 +113,12 @@
100 113 if(!function_exists('get_the_location')){
101 114 /**
102 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;
@@ -116,7 +131,7 @@
116 131 *
117 132 * @param type $post
118 133 */
119 134 function the_location($post=null){
120 - echo get_the_location($post);
135 + echo wp_kses(get_the_location($post), EventPost()->kses_tags);
121 136 }
122 137 }