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/class-shortcodes.php +26 -4 5.12.0 → 6.1.2 View file →
@@ -2,14 +2,16 @@
2 2 /**
3 3 * Implements all shortcodes features
4 4 *
5 5 * @package event-post
6 - * @version 5.12.0
6 + * @version 6.1.2
7 7 * @since 5.0.0
8 8 */
9 9
10 10 namespace EventPost;
11 11
12 +if ( ! defined( 'ABSPATH' ) ) exit;
13 +
12 14 class Shortcodes{
13 15
14 16 function __construct() {
15 17 //Shortcodes
@@ -150,8 +152,9 @@
150 152 'style' => '',
151 153 'pages' => false,
152 154 'container_schema' => EventPost()->list_shema['container'],
153 155 'item_schema' => EventPost()->list_shema['item'],
156 + 'align' => '',
154 157 'className' => '',
155 158 ), 'shortcode_list'), $_atts);
156 159
157 160 if ($atts['container_schema'] != EventPost()->list_shema['container']){
@@ -195,12 +198,15 @@
195 198 * @filter eventpost_params
196 199 *
197 200 * @return string
198 201 */
199 - public function shortcode_timeline($_atts) {
202 + public function shortcode_timeline($_atts, $content='', $block=null) {
200 203 $atts = shortcode_atts(apply_filters('eventpost_params', array(
201 204 // Filters
202 - 'nb' => 0,
205 + 'nb' => 3,
206 + 'nb_desktop' => 0,
207 + 'nb_tablet' => 0,
208 + 'nb_mobile' => 0,
203 209 'future' => true,
204 210 'past' => false,
205 211 'geo' => 0,
206 212 'cat' => '',
@@ -208,8 +214,9 @@
208 214 'tax_name' => '',
209 215 'tax_term' => '',
210 216 'title' => '',
211 217 // Display
218 + 'align' => '',
212 219 'type' => 'div',
213 220 'before_title' => '<h3>',
214 221 'after_title' => '</h3>',
215 222 'excerpt' => '',
@@ -218,15 +225,25 @@
218 225 'style' => '',
219 226 'container_schema' => EventPost()->timeline_shema['container'],
220 227 'item_schema' => EventPost()->timeline_shema['item'],
221 228 'className' => '',
229 + 'order' => 'ASC',
230 + 'direction' => 'horizontal',
231 + 'separate_years' => false,
232 + 'separate_months' => false,
233 + 'size' => 2,
234 + 'color' => '#000000',
222 235 ), 'shortcode_list'), $_atts);
223 236
237 + $atts['className'] .= ' direction-'.$atts['direction'];
238 +
239 + wp_enqueue_script('event-post-timeline');
240 +
224 241 if ($atts['container_schema'] != EventPost()->timeline_shema['container'])
225 242 $atts['container_schema'] = html_entity_decode($atts['container_schema']);
226 243 if ($atts['item_schema'] != EventPost()->timeline_shema['item'])
227 244 $atts['item_schema'] = html_entity_decode($atts['item_schema']);
228 - return EventPost()->list_events($atts, 'event_timeline', 'shortcode');
245 + return EventPost()->list_events($atts, 'event_timeline', $block ? 'block' :'shortcode');
229 246 }
230 247
231 248 /**
232 249 * Shortcode to display a map of events
@@ -268,8 +285,9 @@
268 285 'tax_name' => '',
269 286 'tax_term' => '',
270 287 'orderby' => 'meta_value',
271 288 'order' => 'ASC',
289 + 'align' => '',
272 290 'className' => '',
273 291 );
274 292 // UI options
275 293 foreach(EventPost()->map_interactions as $int_key=>$int_name){
@@ -308,11 +326,13 @@
308 326 'cat' => '',
309 327 'mondayfirst' => 0, // 1 : weeks starts on monday
310 328 'display_title' => 0,
311 329 'datepicker' => 1,
330 + 'swipe' => false,
312 331 'tax_name' => '',
313 332 'tax_term' => '',
314 333 'thumbnail' => '',
334 + 'align' => '',
315 335 'className' => '',
316 336 );
317 337 $atts = shortcode_atts(apply_filters('eventpost_params', $defaults, 'shortcode_cal'), $_atts);
318 338 $atts = array(
@@ -320,8 +340,9 @@
320 340 'cat' => sanitize_text_field($atts['cat']),
321 341 'mondayfirst' => intval($atts['mondayfirst']),
322 342 'display_title' => intval($atts['display_title']),
323 343 'datepicker' => intval($atts['datepicker']),
344 + 'swipe' => intval($atts['swipe']),
324 345 'tax_name' => sanitize_text_field($atts['tax_name']),
325 346 'tax_term' => sanitize_text_field($atts['tax_term']),
326 347 'thumbnail' => sanitize_text_field($atts['thumbnail']),
327 348 'className' => esc_attr($atts['className']),
@@ -340,8 +361,9 @@
340 361 data-date="' . esc_attr($date) . '"
341 362 data-mf="' . esc_attr($mondayfirst) . '"
342 363 data-dp="' . esc_attr($datepicker) . '"
343 364 data-title="'. esc_attr($display_title) .'"
365 + data-swipe="'. esc_attr($swipe) .'"
344 366 >'
345 367 . wp_kses_post(EventPost()->calendar($atts))
346 368 . '</div>';
347 369 }