Timetable and Event Schedule by MotoPress - Version 2.3.19

Version Description

Download this release

Release Info

Developer MotoPress
Plugin Icon 128x128 Timetable and Event Schedule by MotoPress
Version 2.3.19
Comparing to
See all releases

Code changes from version 2.3.18 to 2.3.19

changelog.txt CHANGED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  = 2.3.14, Feb 4 2021 =
2
  * Improved plugin internalization.
3
 
1
+ = 2.3.17, Feb 18 2021 =
2
+ * Bug fix: fixed PHP parse error in PHP 7.2.
3
+
4
+ = 2.3.15, Feb 17 2021 =
5
+ * Added Timetable Elementor widget.
6
+ * Bug fix: fixed an issue with invalid XML file while exporting data.
7
+
8
  = 2.3.14, Feb 4 2021 =
9
  * Improved plugin internalization.
10
 
classes/class-hooks.php CHANGED
@@ -298,7 +298,7 @@ class Hooks extends Core {
298
  $row_meta = array(
299
  'help' => '<a href="' . esc_url( admin_url('edit.php?post_type=mp-event&page=mptt-help') ) . '" aria-label="' . esc_attr__( 'Quick Start Guide', 'mp-timetable' ) . '">' .
300
  esc_html__( 'Help', 'mp-timetable' ) . '</a>',
301
- 'review' => '<a href="' . esc_url( 'https://wordpress.org/support/plugin/mp-timetable/reviews?rate=5#new-post' ) . '" aria-label="' . esc_attr__( 'Leave a Review', 'mp-timetable' ) . '" target="_blank">' . esc_html__( 'Leave a Review', 'mp-timetable' ) . '</a>',
302
  );
303
 
304
  return array_merge( $links, $row_meta );
298
  $row_meta = array(
299
  'help' => '<a href="' . esc_url( admin_url('edit.php?post_type=mp-event&page=mptt-help') ) . '" aria-label="' . esc_attr__( 'Quick Start Guide', 'mp-timetable' ) . '">' .
300
  esc_html__( 'Help', 'mp-timetable' ) . '</a>',
301
+ 'review' => '<a href="' . esc_url( 'https://wordpress.org/support/plugin/mp-timetable/reviews?rate=5#new-post' ) . '" aria-label="' . esc_attr__( 'Leave a Review', 'mp-timetable' ) . '" target="_blank">' . esc_html__( 'Leave a Review', 'mp-timetable' ) . ' &#9733;&#9733;&#9733;&#9733;&#9733;</a>',
302
  );
303
 
304
  return array_merge( $links, $row_meta );
classes/models/class-column.php CHANGED
@@ -195,7 +195,7 @@ class Column extends Model {
195
  if (!empty($params['data'])) {
196
  foreach ($params['data'] as $meta_key => $meta) {
197
  if (!empty($meta)) {
198
- update_post_meta($params['post']->ID, $meta_key, $meta);
199
  } else {
200
  delete_post_meta($params['post']->ID, $meta_key, $meta);
201
  }
195
  if (!empty($params['data'])) {
196
  foreach ($params['data'] as $meta_key => $meta) {
197
  if (!empty($meta)) {
198
+ update_post_meta($params['post']->ID, $meta_key, sanitize_text_field( $meta ) );
199
  } else {
200
  delete_post_meta($params['post']->ID, $meta_key, $meta);
201
  }
classes/models/class-events.php CHANGED
@@ -331,7 +331,7 @@ class Events extends Model {
331
  'event_start' => date( 'H:i', strtotime( $event[ 'event_start' ][ $i ] ) ),
332
  'event_end' => date( 'H:i', strtotime( $event[ 'event_end' ][ $i ] ) ),
333
  'user_id' => $event[ 'user_id' ][ $i ],
334
- 'description' => $event[ 'description' ][ $i ]
335
  )
336
  );
337
  }
@@ -340,7 +340,13 @@ class Events extends Model {
340
  }
341
  if ( ! empty( $params[ 'event_meta' ] ) ) {
342
  foreach ( $params[ 'event_meta' ] as $meta_key => $meta ) {
343
- update_post_meta( $params[ 'post' ]->ID, $meta_key, $meta );
 
 
 
 
 
 
344
  }
345
  }
346
 
@@ -683,7 +689,7 @@ class Events extends Model {
683
  array(
684
  'event_start' => date( 'H:i', strtotime( $data[ 'event_start' ] ) ),
685
  'event_end' => date( 'H:i', strtotime( $data[ 'event_end' ] ) ),
686
- 'description' => $data[ 'description' ],
687
  'column_id' => $data[ 'weekday_ids' ],
688
  'user_id' => $data[ 'user_id' ],
689
  ),
331
  'event_start' => date( 'H:i', strtotime( $event[ 'event_start' ][ $i ] ) ),
332
  'event_end' => date( 'H:i', strtotime( $event[ 'event_end' ][ $i ] ) ),
333
  'user_id' => $event[ 'user_id' ][ $i ],
334
+ 'description' => wp_kses_post( $event[ 'description' ][ $i ] )
335
  )
336
  );
337
  }
340
  }
341
  if ( ! empty( $params[ 'event_meta' ] ) ) {
342
  foreach ( $params[ 'event_meta' ] as $meta_key => $meta ) {
343
+ switch ( $meta_key ) {
344
+ case 'timetable_custom_url':
345
+ update_post_meta( $params[ 'post' ]->ID, $meta_key, esc_url_raw( $meta ) );
346
+ break;
347
+ default:
348
+ update_post_meta( $params[ 'post' ]->ID, $meta_key, wp_kses_post( $meta ) );
349
+ }
350
  }
351
  }
352
 
689
  array(
690
  'event_start' => date( 'H:i', strtotime( $data[ 'event_start' ] ) ),
691
  'event_end' => date( 'H:i', strtotime( $data[ 'event_end' ] ) ),
692
+ 'description' => wp_kses_post( $data[ 'description' ] ),
693
  'column_id' => $data[ 'weekday_ids' ],
694
  'user_id' => $data[ 'user_id' ],
695
  ),
media/css/block-editor.css CHANGED
@@ -1 +1 @@
1
- .wp-block[data-type="mp-timetable/timetable"] div[data-block]{overflow:auto}body.branch-5-6 .components-select-control.timetable-wp56-fix .components-select-control__input,body.branch-5-7 .components-select-control.timetable-wp56-fix .components-select-control__input{height:auto!important}body.branch-5-6 .components-select-control.timetable-wp56-fix .components-input-control__suffix,body.branch-5-7 .components-select-control.timetable-wp56-fix .components-input-control__suffix{display:none!important}
1
+ .wp-block[data-type="mp-timetable/timetable"] div[data-block]{overflow:auto}.components-select-control.timetable-wp56-fix .components-select-control__input{height:auto!important}.components-select-control.timetable-wp56-fix .components-input-control__suffix{display:none!important}.components-select-control.timetable-wp56-fix .components-input-control__label{font-size:inherit}
media/less/block-editor.less CHANGED
@@ -7,11 +7,12 @@
7
  * https://github.com/WordPress/gutenberg/issues/27166
8
  *
9
  */
10
- body.branch-5-6 .components-select-control.timetable-wp56-fix .components-select-control__input,
11
- body.branch-5-7 .components-select-control.timetable-wp56-fix .components-select-control__input {
12
  height: auto !important;
13
  }
14
- body.branch-5-6 .components-select-control.timetable-wp56-fix .components-input-control__suffix,
15
- body.branch-5-7 .components-select-control.timetable-wp56-fix .components-input-control__suffix {
16
  display: none !important;
17
  }
 
 
 
7
  * https://github.com/WordPress/gutenberg/issues/27166
8
  *
9
  */
10
+ .components-select-control.timetable-wp56-fix .components-select-control__input {
 
11
  height: auto !important;
12
  }
13
+ .components-select-control.timetable-wp56-fix .components-input-control__suffix {
 
14
  display: none !important;
15
  }
16
+ .components-select-control.timetable-wp56-fix .components-input-control__label {
17
+ font-size:inherit;
18
+ }
mp-timetable.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Timetable and Event Schedule
5
  * Plugin URI: https://motopress.com/products/timetable-event-schedule/
6
  * Description: Smart time-management tool with a clean minimalist design for featuring your timetables and upcoming events.
7
- * Version: 2.3.18
8
  * Author: MotoPress
9
  * Author URI: https://motopress.com
10
  * License: GPLv2 or later
4
  * Plugin Name: Timetable and Event Schedule
5
  * Plugin URI: https://motopress.com/products/timetable-event-schedule/
6
  * Description: Smart time-management tool with a clean minimalist design for featuring your timetables and upcoming events.
7
+ * Version: 2.3.19
8
  * Author: MotoPress
9
  * Author URI: https://motopress.com
10
  * License: GPLv2 or later
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: MotoPress
3
  Donate link: https://motopress.com/
4
  Tags: schedule, timetable, calendar, event, events calendar, dates, event organizer, booking, appointment, upcoming events
5
  Requires at least: 4.6
6
- Tested up to: 5.7
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -93,19 +93,16 @@ Plugin bundles the following third-party resources:
93
 
94
  == Changelog ==
95
 
 
 
 
 
96
  = 2.3.18, Mar 18 2021 =
97
  * Improved compatibility with WordPress 5.7.
98
 
99
  = 2.3.17, Mar 3 2021 =
100
  * Improved compatibility with WordPress multisite.
101
 
102
- = 2.3.17, Feb 18 2021 =
103
- * Bug fix: fixed PHP parse error in PHP 7.2.
104
-
105
- = 2.3.15, Feb 17 2021 =
106
- * Added Timetable Elementor widget.
107
- * Bug fix: fixed an issue with invalid XML file while exporting data.
108
-
109
  --------
110
 
111
  [See the previous changelogs here](https://plugins.svn.wordpress.org/mp-timetable/trunk/changelog.txt).
3
  Donate link: https://motopress.com/
4
  Tags: schedule, timetable, calendar, event, events calendar, dates, event organizer, booking, appointment, upcoming events
5
  Requires at least: 4.6
6
+ Tested up to: 5.8
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
93
 
94
  == Changelog ==
95
 
96
+ = 2.3.19, Jul 27 2021 =
97
+ * Improved compatibility with WordPress 5.8.
98
+ * Security - Fixed unescaped meta data. Reported by Trustwave.
99
+
100
  = 2.3.18, Mar 18 2021 =
101
  * Improved compatibility with WordPress 5.7.
102
 
103
  = 2.3.17, Mar 3 2021 =
104
  * Improved compatibility with WordPress multisite.
105
 
 
 
 
 
 
 
 
106
  --------
107
 
108
  [See the previous changelogs here](https://plugins.svn.wordpress.org/mp-timetable/trunk/changelog.txt).
templates-functions/action-mp-column-functions.php CHANGED
@@ -17,7 +17,7 @@ function mptt_column_template_content_events_list() {
17
  ?>
18
  <ul class="mptt-column <?php echo apply_filters('mptt_events_list_class', 'events-list') ?>">
19
  <?php foreach ($events as $event): ?>
20
- <li class="event" id="event_columns_<?php echo $event->event_id ?>">
21
 
22
  <?php if (has_post_thumbnail($event->event_id)) {
23
 
@@ -35,29 +35,36 @@ function mptt_column_template_content_events_list() {
35
  <?php } ?>
36
 
37
  <h4 class="event-title">
38
- <a href="<?php echo $event->post->timetable_disable_url == '1' ? '#' : ($event->post->timetable_custom_url != "" ? $event->post->timetable_custom_url : get_permalink($event->event_id)) ?>"
39
- class="event-link">
 
 
 
 
40
  <?php echo get_the_title($event->event_id); ?>
41
  </a>
42
  </h4>
43
 
44
  <p class="timeslot">
45
- <time datetime="<?php echo $event->event_start; ?>"
46
- class="timeslot-start"><?php echo date(get_option('time_format'), strtotime($event->event_start)); ?></time><?php echo apply_filters('mptt_timeslot_delimiter', ' - '); ?>
47
- <time datetime="<?php echo $event->event_end; ?>" class="timeslot-end"><?php echo date(get_option('time_format'), strtotime($event->event_end)); ?></time>
 
 
48
  </p>
49
 
50
  <?php if (!empty($event->post->sub_title)) { ?>
51
- <p class="event-subtitle"><?php echo $event->post->sub_title ?></p>
52
  <?php } ?>
53
 
54
  <?php if (!empty($event->description)) { ?>
55
- <p class="event-description"><?php echo stripslashes( $event->description ); ?></p>
56
  <?php } ?>
57
 
58
  <?php if (!empty($event->user)) { ?>
59
  <p class="event-user"><a href="<?php echo get_author_posts_url($event->user->ID); ?>"
60
- title="<?php the_title_attribute(array('post' => $event->event_id)); ?>"><?php echo get_avatar($event->user->ID, apply_filters('mptt-column-user-avatar-size', 32), '', $event->user->display_name); ?>
 
61
  <?php echo $event->user->display_name ?></a></p>
62
  <?php } ?>
63
  <div class="mptt-clearfix"></div>
17
  ?>
18
  <ul class="mptt-column <?php echo apply_filters('mptt_events_list_class', 'events-list') ?>">
19
  <?php foreach ($events as $event): ?>
20
+ <li class="event" id="event_columns_<?php echo esc_attr( $event->event_id ); ?>">
21
 
22
  <?php if (has_post_thumbnail($event->event_id)) {
23
 
35
  <?php } ?>
36
 
37
  <h4 class="event-title">
38
+ <a href="<?php echo
39
+ $event->post->timetable_disable_url == '1' ? '#' :
40
+ ($event->post->timetable_custom_url != "" ?
41
+ esc_url( $event->post->timetable_custom_url ) :
42
+ get_permalink($event->event_id)
43
+ ) ?>" class="event-link">
44
  <?php echo get_the_title($event->event_id); ?>
45
  </a>
46
  </h4>
47
 
48
  <p class="timeslot">
49
+ <time datetime="<?php echo esc_attr( $event->event_start ); ?>" class="timeslot-start"><?php
50
+ echo date(get_option('time_format'), strtotime($event->event_start)); ?></time>
51
+ <?php echo apply_filters('mptt_timeslot_delimiter', ' - '); ?>
52
+ <time datetime="<?php echo esc_attr( $event->event_end ); ?>" class="timeslot-end"><?php
53
+ echo date(get_option('time_format'), strtotime($event->event_end)); ?></time>
54
  </p>
55
 
56
  <?php if (!empty($event->post->sub_title)) { ?>
57
+ <p class="event-subtitle"><?php echo wp_kses_post( $event->post->sub_title ); ?></p>
58
  <?php } ?>
59
 
60
  <?php if (!empty($event->description)) { ?>
61
+ <p class="event-description"><?php echo wp_kses_post( stripslashes( $event->description ) ); ?></p>
62
  <?php } ?>
63
 
64
  <?php if (!empty($event->user)) { ?>
65
  <p class="event-user"><a href="<?php echo get_author_posts_url($event->user->ID); ?>"
66
+ title="<?php the_title_attribute(array('post' => $event->event_id)); ?>"><?php
67
+ echo get_avatar($event->user->ID, apply_filters('mptt-column-user-avatar-size', 32), '', $event->user->display_name); ?>
68
  <?php echo $event->user->display_name ?></a></p>
69
  <?php } ?>
70
  <div class="mptt-clearfix"></div>
templates-functions/action-shortcode-functions.php CHANGED
@@ -241,22 +241,22 @@ function mptt_shortcode_template_content_responsive_table() {
241
  <?php if ( ! empty( $mptt_shortcode_data[ 'events_data' ] ) ):
242
  foreach ( $mptt_shortcode_data[ 'events_data' ][ 'column' ] as $column ): ?>
243
  <div class="mptt-column">
244
- <h3 class="mptt-column-title"><?php echo $column->post_title ?></h3>
245
  <ul class="mptt-events-list">
246
  <?php if ( ! empty( $mptt_shortcode_data[ 'events_data' ][ 'column_events' ][ $column->ID ] ) ):
247
  foreach ( $mptt_shortcode_data[ 'events_data' ][ 'column_events' ][ $column->ID ] as $event ) : ?>
248
- <li class="mptt-list-event" data-event-id="<?php echo $event->post->post_name ?>"
249
  <?php if ( ! empty( $event->post->color ) ) {
250
  echo 'style="border-left-color:' . $event->post->color . ';"';
251
  } ?>>
252
  <?php if ( $mptt_shortcode_data[ 'params' ][ 'title' ] ):
253
  $disable_url = (bool) $event->post->timetable_disable_url || (bool) $mptt_shortcode_data[ 'params' ][ 'disable_event_url' ];
254
  if ( ! $disable_url ) { ?>
255
- <a title="<?php echo $event->post->post_title; ?>"
256
- href="<?php echo ( $event->post->timetable_custom_url != "" ) ? $event->post->timetable_custom_url : get_permalink( $event->event_id ); ?>"
257
  class="mptt-event-title">
258
  <?php }
259
- echo $event->post->post_title;
260
 
261
  if ( ! $disable_url ) { ?>
262
  </a>
@@ -265,24 +265,26 @@ function mptt_shortcode_template_content_responsive_table() {
265
  endif;
266
  if ( $mptt_shortcode_data[ 'params' ][ 'time' ] ): ?>
267
  <p class="timeslot">
268
- <time datetime="<?php echo $event->event_start; ?>" class="timeslot-start"><?php echo date( get_option( 'time_format' ), strtotime( $event->event_start ) ); ?></time>
 
269
  <span class="timeslot-delimiter"><?php echo apply_filters( 'mptt_timeslot_delimiter', ' - ' ); ?></span>
270
- <time datetime="<?php echo $event->event_end; ?>" class="timeslot-end"><?php echo date( get_option( 'time_format' ), strtotime( $event->event_end ) ); ?></time>
 
271
  </p>
272
  <?php endif;
273
  if ( $mptt_shortcode_data[ 'params' ][ 'sub-title' ] && ! empty( $event->post->sub_title ) ): ?>
274
- <p class="event-subtitle"><?php echo $event->post->sub_title; ?></p>
275
  <?php endif;
276
  if ( $mptt_shortcode_data[ 'params' ][ 'description' ] ): ?>
277
  <p class="event-description"><?php
278
- echo stripslashes( $event->description );
279
  ?></p>
280
  <?php endif;
281
  if ( $mptt_shortcode_data[ 'params' ][ 'user' ] && ( $event->user_id != '-1' ) ): ?>
282
  <p class="event-user"><?php $user_info = get_userdata( $event->user_id );
283
  if ( $user_info ) {
284
  echo get_avatar( $event->user_id, apply_filters( 'mptt-event-user-avatar-size', 24 ), '', $user_info->data->display_name ) . ' ';
285
- echo $user_info->data->display_name;
286
  } ?></p>
287
  <?php endif; ?>
288
  </li>
241
  <?php if ( ! empty( $mptt_shortcode_data[ 'events_data' ] ) ):
242
  foreach ( $mptt_shortcode_data[ 'events_data' ][ 'column' ] as $column ): ?>
243
  <div class="mptt-column">
244
+ <h3 class="mptt-column-title"><?php echo esc_html( $column->post_title ); ?></h3>
245
  <ul class="mptt-events-list">
246
  <?php if ( ! empty( $mptt_shortcode_data[ 'events_data' ][ 'column_events' ][ $column->ID ] ) ):
247
  foreach ( $mptt_shortcode_data[ 'events_data' ][ 'column_events' ][ $column->ID ] as $event ) : ?>
248
+ <li class="mptt-list-event" data-event-id="<?php echo esc_attr( $event->post->post_name ); ?>"
249
  <?php if ( ! empty( $event->post->color ) ) {
250
  echo 'style="border-left-color:' . $event->post->color . ';"';
251
  } ?>>
252
  <?php if ( $mptt_shortcode_data[ 'params' ][ 'title' ] ):
253
  $disable_url = (bool) $event->post->timetable_disable_url || (bool) $mptt_shortcode_data[ 'params' ][ 'disable_event_url' ];
254
  if ( ! $disable_url ) { ?>
255
+ <a title="<?php echo esc_attr( $event->post->post_title ); ?>"
256
+ href="<?php echo ( $event->post->timetable_custom_url != "" ) ? esc_url( $event->post->timetable_custom_url ) : get_permalink( $event->event_id ); ?>"
257
  class="mptt-event-title">
258
  <?php }
259
+ echo esc_html( $event->post->post_title );
260
 
261
  if ( ! $disable_url ) { ?>
262
  </a>
265
  endif;
266
  if ( $mptt_shortcode_data[ 'params' ][ 'time' ] ): ?>
267
  <p class="timeslot">
268
+ <time datetime="<?php echo esc_attr( $event->event_start ); ?>" class="timeslot-start"><?php
269
+ echo esc_html( date( get_option( 'time_format' ), strtotime( $event->event_start ) ) ); ?></time>
270
  <span class="timeslot-delimiter"><?php echo apply_filters( 'mptt_timeslot_delimiter', ' - ' ); ?></span>
271
+ <time datetime="<?php echo esc_attr( $event->event_end ); ?>" class="timeslot-end"><?php
272
+ echo esc_html( date( get_option( 'time_format' ), strtotime( $event->event_end ) ) ); ?></time>
273
  </p>
274
  <?php endif;
275
  if ( $mptt_shortcode_data[ 'params' ][ 'sub-title' ] && ! empty( $event->post->sub_title ) ): ?>
276
+ <p class="event-subtitle"><?php echo wp_kses_post( $event->post->sub_title ); ?></p>
277
  <?php endif;
278
  if ( $mptt_shortcode_data[ 'params' ][ 'description' ] ): ?>
279
  <p class="event-description"><?php
280
+ echo wp_kses_post( stripslashes( $event->description ) );
281
  ?></p>
282
  <?php endif;
283
  if ( $mptt_shortcode_data[ 'params' ][ 'user' ] && ( $event->user_id != '-1' ) ): ?>
284
  <p class="event-user"><?php $user_info = get_userdata( $event->user_id );
285
  if ( $user_info ) {
286
  echo get_avatar( $event->user_id, apply_filters( 'mptt-event-user-avatar-size', 24 ), '', $user_info->data->display_name ) . ' ';
287
+ echo esc_html( $user_info->data->display_name );
288
  } ?></p>
289
  <?php endif; ?>
290
  </li>
templates-functions/actions-mp-event-functions.php CHANGED
@@ -48,14 +48,16 @@ function mptt_event_template_content_time_list() {
48
  echo date(get_option('time_format'), strtotime($event->event_end)); ?></time>
49
  </p>
50
  <?php if (!empty($event->post->sub_title)) { ?>
51
- <p class="event-subtitle"><?php echo $event->post->sub_title; ?></p>
52
  <?php } ?>
53
 
54
  <?php if (!empty($event->description)) { ?>
55
- <p class="event-description"><?php echo stripslashes( $event->description ); ?></p>
56
  <?php } ?>
57
  <?php if (!empty($event->user)) { ?>
58
- <p class="event-user"><a href="<?php echo get_author_posts_url($event->user->ID); ?>" title="<?php echo $event->user->display_name; ?>"><?php echo get_avatar($event->user->ID, apply_filters('mptt-column-user-avatar-size', 32), '', $event->user->display_name) . ' ';
 
 
59
  echo $event->user->display_name ?></a></p>
60
  <?php } ?>
61
  </li>
48
  echo date(get_option('time_format'), strtotime($event->event_end)); ?></time>
49
  </p>
50
  <?php if (!empty($event->post->sub_title)) { ?>
51
+ <p class="event-subtitle"><?php echo wp_kses_post( $event->post->sub_title ); ?></p>
52
  <?php } ?>
53
 
54
  <?php if (!empty($event->description)) { ?>
55
+ <p class="event-description"><?php echo wp_kses_post( stripslashes( $event->description ) ); ?></p>
56
  <?php } ?>
57
  <?php if (!empty($event->user)) { ?>
58
+ <p class="event-user"><a href="<?php echo get_author_posts_url($event->user->ID); ?>" title="<?php
59
+ echo $event->user->display_name; ?>"><?php
60
+ echo get_avatar($event->user->ID, apply_filters('mptt-column-user-avatar-size', 32), '', $event->user->display_name) . ' ';
61
  echo $event->user->display_name ?></a></p>
62
  <?php } ?>
63
  </li>
templates/events/column-category.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  foreach ($terms as $term) {
4
- ?><a href="<?php echo get_term_link($term->term_id) ?>" rel="tag" title="<?php echo $term->name; ?>"><?php
5
- echo $term->name ?></a><?php echo ($term !== end($terms)) ? ', ' : '' ?>
6
  <?php
7
  }
1
  <?php
2
 
3
  foreach ($terms as $term) {
4
+ ?><a href="<?php echo get_term_link($term->term_id) ?>" rel="tag" title="<?php echo esc_attr( $term->name ); ?>"><?php
5
+ echo esc_html( $term->name ); ?></a><?php echo ($term !== end($terms)) ? ', ' : '' ?>
6
  <?php
7
  }
templates/events/event-data.php CHANGED
@@ -21,10 +21,10 @@
21
  <?php if (!empty($event_data)): ?>
22
  <?php foreach ($event_data as $data): ?>
23
  <tr data-id="<?php echo $data->id ?>">
24
- <td class="event-column"><?php echo get_the_title($data->column_id); ?></td>
25
  <td class="event-start"><?php echo date(get_option('time_format'), strtotime($data->event_start)); ?></td>
26
  <td class="event-end"><?php echo date(get_option('time_format'), strtotime($data->event_end)); ?></td>
27
- <td class="event-description"><?php echo $data->description; ?></td>
28
  <td class="event-user-id"><?php
29
  $user = ($data->user_id != '-1') ? get_userdata($data->user_id) : false;
30
  if ($user) {
21
  <?php if (!empty($event_data)): ?>
22
  <?php foreach ($event_data as $data): ?>
23
  <tr data-id="<?php echo $data->id ?>">
24
+ <td class="event-column"><?php echo esc_html( get_the_title($data->column_id) ); ?></td>
25
  <td class="event-start"><?php echo date(get_option('time_format'), strtotime($data->event_start)); ?></td>
26
  <td class="event-end"><?php echo date(get_option('time_format'), strtotime($data->event_end)); ?></td>
27
+ <td class="event-description"><?php echo wp_kses_post( $data->description ); ?></td>
28
  <td class="event-user-id"><?php
29
  $user = ($data->user_id != '-1') ? get_userdata($data->user_id) : false;
30
  if ($user) {
templates/events/metabox-event-options.php CHANGED
@@ -35,7 +35,7 @@
35
  <tr>
36
  <td><label for="timetable_custom_url"><?php _e('Custom Event URL:', 'mp-timetable'); ?></label></td>
37
  <td>
38
- <input type="text" id="timetable_custom_url" class="widefat" placeholder="http://mywebsite.com" name="event_meta[timetable_custom_url]" value="<?php echo esc_attr( $post->timetable_custom_url ); ?>">
39
  </td>
40
  </tr>
41
  <tr>
35
  <tr>
36
  <td><label for="timetable_custom_url"><?php _e('Custom Event URL:', 'mp-timetable'); ?></label></td>
37
  <td>
38
+ <input type="text" id="timetable_custom_url" class="widefat" placeholder="http://mywebsite.com" name="event_meta[timetable_custom_url]" value="<?php echo esc_url( $post->timetable_custom_url ); ?>">
39
  </td>
40
  </tr>
41
  <tr>
templates/shortcodes/event-container.php CHANGED
@@ -1,52 +1,60 @@
1
  <?php $item[ 'post' ] = get_post( $item[ 'event_id' ] ); ?>
2
- <div data-event-id="<?php echo $item[ 'event_id' ] ?>" data-start="<?php echo empty( $startIndex ) ? $item[ 'start_index' ] : $startIndex ?>" data-start-item="<?php echo $item[ 'start_index' ] ?>"
3
- data-end="<?php echo $item[ 'end_index' ] ?>"
4
- class="mptt-event-container id-<?php echo $item[ 'id' ]; ?> mptt-colorized"
 
 
5
  data-type="event"
6
- data-bg_hover_color="<?php echo $item[ 'post' ]->hover_color ? $item[ 'post' ]->hover_color : '' ?>"
7
- data-bg_color="<?php echo $item[ 'post' ]->color ? $item[ 'post' ]->color : '' ?>"
8
- data-hover_color="<?php echo $item[ 'post' ]->hover_text_color ? $item[ 'post' ]->hover_text_color : '' ?>"
9
- data-color="<?php echo $item[ 'post' ]->text_color ? $item[ 'post' ]->text_color : '' ?>"
10
  data-min-height=""
11
- style="<?php echo $params[ 'text_align' ] ? 'text-align:' . $params[ 'text_align' ] . ';' : '' ?>
12
- <?php echo $item[ 'post' ]->color ? 'background-color:' . $item[ 'post' ]->color . ';' : '' ?>
13
- <?php echo $item[ 'post' ]->text_color ? 'color:' . $item[ 'post' ]->text_color . ';' : '' ?>
14
- <?php echo ! empty( $height ) ? 'height:' . $height . '%;' : '' ?>
15
- <?php echo ! empty( $top ) ? 'top:' . $top . '%;' : '' ?>">
16
  <div class="mptt-inner-event-content">
17
  <?php if ( $params[ 'title' ] ) {
18
  $disable_url = (bool) $item[ 'post' ]->timetable_disable_url || (bool) $params[ 'disable_event_url' ];
19
 
20
  if ( ! $disable_url ) { ?>
21
- <a title="<?php echo $item[ 'post' ]->post_title; ?>" href="<?php echo ( $item[ 'post' ]->timetable_custom_url != "" ) ? $item[ 'post' ]->timetable_custom_url : get_permalink( $item[ 'event_id' ] ); ?>" class="event-title"><?php echo $item[ 'post' ]->post_title; ?></a>
 
 
 
 
22
  <?php }
23
 
24
  if ( $disable_url ) { ?>
25
- <span class="event-title"><?php echo $item[ 'post' ]->post_title; ?></span>
26
  <?php }
27
  }
28
 
29
  if ( $params[ 'time' ] ): ?>
30
  <p class="timeslot">
31
- <time datetime="<?php echo $item[ 'event_start' ]; ?>" class="timeslot-start"><?php echo date( get_option( 'time_format' ), strtotime( $item[ 'event_start' ] ) ); ?></time>
 
32
  <span class="timeslot-delimiter"><?php echo apply_filters( 'mptt_timeslot_delimiter', ' - ' ); ?></span>
33
- <time datetime="<?php echo $item[ 'event_end' ]; ?>" class="timeslot-end"><?php echo date( get_option( 'time_format' ), strtotime( $item[ 'event_end' ] ) ); ?></time>
 
34
  </p>
35
  <?php endif;
36
 
37
  if ( $params[ 'sub-title' ] && ! empty( $item[ 'post' ]->sub_title ) ): ?>
38
- <p class="event-subtitle"><?php echo $item[ 'post' ]->sub_title; ?></p>
39
  <?php endif;
40
 
41
  if ( $params[ 'description' ] && ! empty( $item[ 'description' ] ) ): ?>
42
- <p class="event-description"><?php echo stripslashes( $item[ 'description' ] ); ?></p>
43
  <?php endif;
44
 
45
  if ( $params[ 'user' ] && $item[ 'user_id' ] != '-1' ): ?>
46
  <p class="event-user"><?php $user_info = get_userdata( $item[ 'user_id' ] );
47
  if ( $user_info ) {
48
  echo get_avatar( $item[ 'user_id' ], apply_filters( 'mptt-event-user-avatar-size', 24 ), '', $user_info->data->display_name );
49
- echo $user_info->data->display_name;
50
  } ?>
51
  </p>
52
  <?php endif; ?>
1
  <?php $item[ 'post' ] = get_post( $item[ 'event_id' ] ); ?>
2
+ <div data-event-id="<?php echo esc_attr( $item[ 'event_id' ] ); ?>"
3
+ data-start="<?php echo esc_attr( empty( $startIndex ) ? $item[ 'start_index' ] : $startIndex ); ?>"
4
+ data-start-item="<?php echo esc_attr( $item[ 'start_index' ] ); ?>"
5
+ data-end="<?php echo esc_attr( $item[ 'end_index' ] ); ?>"
6
+ class="mptt-event-container id-<?php echo esc_attr( $item[ 'id' ] ); ?> mptt-colorized"
7
  data-type="event"
8
+ data-bg_hover_color="<?php echo esc_attr( $item[ 'post' ]->hover_color ? $item[ 'post' ]->hover_color : '' ); ?>"
9
+ data-bg_color="<?php echo esc_attr( $item[ 'post' ]->color ? $item[ 'post' ]->color : '' ); ?>"
10
+ data-hover_color="<?php echo esc_attr( $item[ 'post' ]->hover_text_color ? $item[ 'post' ]->hover_text_color : '' ); ?>"
11
+ data-color="<?php echo esc_attr( $item[ 'post' ]->text_color ? $item[ 'post' ]->text_color : '' ); ?>"
12
  data-min-height=""
13
+ style="<?php echo esc_attr( $params[ 'text_align' ] ? 'text-align:' . $params[ 'text_align' ] . ';' : '' ); ?>
14
+ <?php echo esc_attr( $item[ 'post' ]->color ? 'background-color:' . $item[ 'post' ]->color . ';' : '' ); ?>
15
+ <?php echo esc_attr( $item[ 'post' ]->text_color ? 'color:' . $item[ 'post' ]->text_color . ';' : '' ); ?>
16
+ <?php echo esc_attr( ! empty( $height ) ? 'height:' . $height . '%;' : '' ); ?>
17
+ <?php echo esc_attr( ! empty( $top ) ? 'top:' . $top . '%;' : '' ); ?>">
18
  <div class="mptt-inner-event-content">
19
  <?php if ( $params[ 'title' ] ) {
20
  $disable_url = (bool) $item[ 'post' ]->timetable_disable_url || (bool) $params[ 'disable_event_url' ];
21
 
22
  if ( ! $disable_url ) { ?>
23
+ <a title="<?php echo esc_attr( $item[ 'post' ]->post_title ); ?>" href="<?php
24
+ echo ( $item[ 'post' ]->timetable_custom_url != "" ) ?
25
+ esc_url( $item[ 'post' ]->timetable_custom_url ) :
26
+ get_permalink( $item[ 'event_id' ] );
27
+ ?>" class="event-title"><?php echo esc_html( $item[ 'post' ]->post_title ); ?></a>
28
  <?php }
29
 
30
  if ( $disable_url ) { ?>
31
+ <span class="event-title"><?php echo esc_html( $item[ 'post' ]->post_title ); ?></span>
32
  <?php }
33
  }
34
 
35
  if ( $params[ 'time' ] ): ?>
36
  <p class="timeslot">
37
+ <time datetime="<?php echo esc_attr( $item[ 'event_start' ] ); ?>" class="timeslot-start"><?php
38
+ echo esc_html( date( get_option( 'time_format' ), strtotime( $item[ 'event_start' ] ) ) ); ?></time>
39
  <span class="timeslot-delimiter"><?php echo apply_filters( 'mptt_timeslot_delimiter', ' - ' ); ?></span>
40
+ <time datetime="<?php echo esc_attr( $item[ 'event_end' ] ); ?>" class="timeslot-end"><?php
41
+ echo esc_html( date( get_option( 'time_format' ), strtotime( $item[ 'event_end' ] ) ) ); ?></time>
42
  </p>
43
  <?php endif;
44
 
45
  if ( $params[ 'sub-title' ] && ! empty( $item[ 'post' ]->sub_title ) ): ?>
46
+ <p class="event-subtitle"><?php echo wp_kses_post( $item[ 'post' ]->sub_title ); ?></p>
47
  <?php endif;
48
 
49
  if ( $params[ 'description' ] && ! empty( $item[ 'description' ] ) ): ?>
50
+ <p class="event-description"><?php echo wp_kses_post( stripslashes( $item[ 'description' ] ) ); ?></p>
51
  <?php endif;
52
 
53
  if ( $params[ 'user' ] && $item[ 'user_id' ] != '-1' ): ?>
54
  <p class="event-user"><?php $user_info = get_userdata( $item[ 'user_id' ] );
55
  if ( $user_info ) {
56
  echo get_avatar( $item[ 'user_id' ], apply_filters( 'mptt-event-user-avatar-size', 24 ), '', $user_info->data->display_name );
57
+ echo esc_html( $user_info->data->display_name );
58
  } ?>
59
  </p>
60
  <?php endif; ?>
templates/shortcodes/table-header.php CHANGED
@@ -4,7 +4,7 @@
4
  if (!$column[ 'output' ]) {
5
  continue;
6
  } ?>
7
- <th data-index="<?php echo $key ?>" data-column-id="<?php echo $column[ 'id' ] ?>"><?php echo $column[ 'title' ] ?></th>
8
  <?php endforeach; ?>
9
  </tr>
10
  </thead>
4
  if (!$column[ 'output' ]) {
5
  continue;
6
  } ?>
7
+ <th data-index="<?php echo esc_attr( $key ); ?>" data-column-id="<?php echo esc_attr( $column[ 'id' ] ); ?>"><?php echo esc_html( $column[ 'title' ] ); ?></th>
8
  <?php endforeach; ?>
9
  </tr>
10
  </thead>
templates/single-mp-event.php CHANGED
@@ -7,7 +7,7 @@ do_action('mptt_before_main_wrapper');
7
  while (have_posts()) : the_post();
8
  ?>
9
  <div <?php post_class(apply_filters('mptt_main_wrapper_class', 'mptt-main-wrapper')) ?>>
10
- <div class="<?php echo apply_filters('mptt_event_template_content_class', 'mptt-content') ?>">
11
  <?php
12
  /**
13
  * add_action('mptt_event_item_content', 'mptt_event_template_content_title', 10);
@@ -19,7 +19,7 @@ while (have_posts()) : the_post();
19
  do_action('mptt_event_item_content');
20
  ?>
21
  </div>
22
- <div class="<?php echo apply_filters('mptt_sidebar_class', 'mptt-sidebar') ?>">
23
  <?php
24
  do_action('mptt_sidebar');
25
  ?>
7
  while (have_posts()) : the_post();
8
  ?>
9
  <div <?php post_class(apply_filters('mptt_main_wrapper_class', 'mptt-main-wrapper')) ?>>
10
+ <div class="<?php echo esc_attr( apply_filters('mptt_event_template_content_class', 'mptt-content') ); ?>">
11
  <?php
12
  /**
13
  * add_action('mptt_event_item_content', 'mptt_event_template_content_title', 10);
19
  do_action('mptt_event_item_content');
20
  ?>
21
  </div>
22
+ <div class="<?php echo esc_attr( apply_filters('mptt_sidebar_class', 'mptt-sidebar') ); ?>">
23
  <?php
24
  do_action('mptt_sidebar');
25
  ?>
templates/taxonomies/taxonomy-link.php CHANGED
@@ -1 +1,2 @@
1
- <a rel="tag" href="<?php echo $data["filter_link"]; ?>" title="<?php echo $data["wp"]->name; ?>"><?php echo $data["wp"]->name ?></a>
 
1
+ <a rel="tag" href="<?php echo esc_url( $data["filter_link"] ); ?>" title="<?php
2
+ echo esc_attr( $data["wp"]->name ); ?>"><?php echo esc_html( $data["wp"]->name ); ?></a>
templates/theme/column-events.php CHANGED
@@ -5,39 +5,62 @@ do_action('mptt_column_events_before_events', $events);
5
 
6
  if ( !empty($events) ) {
7
 
8
- foreach ($events as $event): ?>
9
- <p class="event mptt-theme-mode-event" id="event_<?php echo $event->event_id ?>">
 
10
 
11
- <?php if (has_post_thumbnail($event->event_id)) {
12
- echo wp_get_attachment_image( get_post_thumbnail_id($event->event_id), apply_filters('mptt_event_thumbnail_size', 'thumbnail'), false, array('class' => "alignleft event-thumbnail", 'alt' => get_the_title($event->event_id)));
13
- } else { ?>
14
- <img class="alignleft event-thumbnail event-thumbnail-default" src="<?php echo \Mp_Time_Table::get_plugin_url() . 'media/css/images/column_icon.png' ?>">
15
- <?php } ?>
 
 
 
 
 
 
 
 
 
16
 
17
- <a href="<?php echo $event->post->timetable_disable_url == '1' ? '#' : ($event->post->timetable_custom_url != "" ? $event->post->timetable_custom_url : get_permalink($event->event_id)) ?>" class="event-link">
18
- <?php echo get_the_title($event->event_id); ?>
 
 
 
 
 
19
  </a>
20
 
21
  <br/>
22
 
23
- <time datetime="<?php echo $event->event_start; ?>" class="timeslot-start"><?php echo date($time_format, strtotime($event->event_start)); ?></time><?php echo apply_filters('mptt_timeslot_delimiter', ' - '); ?>
24
- <time datetime="<?php echo $event->event_end; ?>" class="timeslot-end"><?php echo date($time_format, strtotime($event->event_end)); ?></time>
 
 
 
25
 
26
- <?php if (!empty($event->post->sub_title)) { ?>
27
  <br/>
28
- <span class="event-subtitle"><?php echo $event->post->sub_title ?></span>
29
  <?php } ?>
30
 
31
  <?php if (!empty($event->description)) { ?>
32
  <br/>
33
- <span class="event-description"><?php echo stripslashes( $event->description ); ?></span>
34
  <?php } ?>
35
 
36
  <?php if (!empty($event->user)) { ?>
37
  <br/>
38
  <span class="event-user vcard">
39
- <?php echo get_avatar($event->user->ID, apply_filters('mptt_column_events_avatar_size', 32), '', $event->user->display_name); ?>
40
- <?php echo $event->user->display_name ?>
 
 
 
 
 
41
  </span>
42
  <?php } ?>
43
  </p>
5
 
6
  if ( !empty($events) ) {
7
 
8
+ foreach ($events as $event):
9
+ ?>
10
+ <p class="event mptt-theme-mode-event" id="event_<?php echo esc_attr( $event->event_id ); ?>">
11
 
12
+ <?php if ( has_post_thumbnail( $event->event_id ) ) {
13
+ echo wp_get_attachment_image(
14
+ get_post_thumbnail_id($event->event_id),
15
+ apply_filters('mptt_event_thumbnail_size', 'thumbnail'),
16
+ false,
17
+ array(
18
+ 'class' => "alignleft event-thumbnail",
19
+ 'alt' => get_the_title($event->event_id)
20
+ )
21
+ );
22
+ } else {
23
+ ?><img class="alignleft event-thumbnail event-thumbnail-default" src="<?php
24
+ echo \Mp_Time_Table::get_plugin_url() . 'media/css/images/column_icon.png' ?>"><?php
25
+ } ?>
26
 
27
+ <a href="<?php echo
28
+ $event->post->timetable_disable_url == '1' ? '#' :
29
+ ($event->post->timetable_custom_url != "" ?
30
+ esc_url( $event->post->timetable_custom_url ) :
31
+ get_permalink($event->event_id)
32
+ ) ?>" class="event-link">
33
+ <?php echo esc_html( get_the_title($event->event_id) ); ?>
34
  </a>
35
 
36
  <br/>
37
 
38
+ <time datetime="<?php echo esc_attr( $event->event_start ); ?>" class="timeslot-start"><?php
39
+ echo esc_html( date($time_format, strtotime($event->event_start)) ); ?></time>
40
+ <?php echo apply_filters('mptt_timeslot_delimiter', ' - '); ?>
41
+ <time datetime="<?php echo esc_attr( $event->event_end ); ?>" class="timeslot-end"><?php
42
+ echo esc_html( date($time_format, strtotime($event->event_end)) ); ?></time>
43
 
44
+ <?php if ( !empty($event->post->sub_title) ) { ?>
45
  <br/>
46
+ <span class="event-subtitle"><?php echo wp_kses_post( $event->post->sub_title ); ?></span>
47
  <?php } ?>
48
 
49
  <?php if (!empty($event->description)) { ?>
50
  <br/>
51
+ <span class="event-description"><?php echo wp_kses_post( stripslashes( $event->description ) ); ?></span>
52
  <?php } ?>
53
 
54
  <?php if (!empty($event->user)) { ?>
55
  <br/>
56
  <span class="event-user vcard">
57
+ <?php echo get_avatar(
58
+ $event->user->ID,
59
+ apply_filters('mptt_column_events_avatar_size', 32),
60
+ '',
61
+ $event->user->display_name
62
+ ); ?>
63
+ <?php echo esc_html( $event->user->display_name ); ?>
64
  </span>
65
  <?php } ?>
66
  </p>
templates/theme/event-timeslots.php CHANGED
@@ -15,26 +15,34 @@ if ( !empty($events) ) {
15
  foreach ($events as $event): ?>
16
  <p class="timeslot">
17
 
18
- <a class="timeslot-link" href="<?php echo get_permalink($event->column_id); ?>"><?php echo get_the_title($event->column_id); ?></a>
 
19
 
20
  <br/>
21
- <time datetime="<?php echo $event->event_start; ?>" class="timeslot-start"><?php echo date($time_format, strtotime($event->event_start)); ?></time>
 
22
  <?php echo apply_filters('mptt_timeslot_delimiter', ' - '); ?>
23
- <time datetime="<?php echo $event->event_start; ?>" class="timeslot-end"><?php echo date($time_format, strtotime($event->event_end)); ?></time>
 
24
 
25
  <?php if (!empty($event->post->sub_title)) { ?>
26
  <br/>
27
- <span class="timeslot-subtitle"><?php echo $event->post->sub_title; ?></span>
28
  <?php } ?>
29
 
30
  <?php if (!empty($event->description)) { ?>
31
  <br/>
32
- <span class="timeslot-description"><?php echo stripslashes( $event->description ); ?></span>
33
  <?php } ?>
34
  <?php if (!empty($event->user)) { ?>
35
  <br/>
36
  <span class="timeslot-user vcard">
37
- <?php echo get_avatar($event->user->ID, apply_filters('mptt_event_timeslots_avatar_size', 32), '', $event->user->display_name); ?> <?php echo $event->user->display_name; ?>
 
 
 
 
 
38
  </span>
39
  <?php } ?>
40
 
15
  foreach ($events as $event): ?>
16
  <p class="timeslot">
17
 
18
+ <a class="timeslot-link" href="<?php echo esc_url( get_permalink($event->column_id) ); ?>"><?php
19
+ echo esc_html( get_the_title($event->column_id) ); ?></a>
20
 
21
  <br/>
22
+ <time datetime="<?php echo esc_attr( $event->event_start ); ?>" class="timeslot-start"><?php
23
+ echo esc_html( date($time_format, strtotime($event->event_start)) ); ?></time>
24
  <?php echo apply_filters('mptt_timeslot_delimiter', ' - '); ?>
25
+ <time datetime="<?php echo esc_attr( $event->event_end ); ?>" class="timeslot-end"><?php
26
+ echo esc_html( date($time_format, strtotime($event->event_end)) ); ?></time>
27
 
28
  <?php if (!empty($event->post->sub_title)) { ?>
29
  <br/>
30
+ <span class="timeslot-subtitle"><?php echo wp_kses_post( $event->post->sub_title ); ?></span>
31
  <?php } ?>
32
 
33
  <?php if (!empty($event->description)) { ?>
34
  <br/>
35
+ <span class="timeslot-description"><?php echo wp_kses_post( stripslashes( $event->description ) ); ?></span>
36
  <?php } ?>
37
  <?php if (!empty($event->user)) { ?>
38
  <br/>
39
  <span class="timeslot-user vcard">
40
+ <?php echo get_avatar(
41
+ $event->user->ID,
42
+ apply_filters('mptt_event_timeslots_avatar_size', 32),
43
+ '',
44
+ $event->user->display_name
45
+ ); ?> <?php echo esc_html( $event->user->display_name ); ?>
46
  </span>
47
  <?php } ?>
48
 
templates/theme/widget-upcoming-view.php CHANGED
@@ -21,29 +21,32 @@ foreach ($events as $event) {
21
  if (!empty($events)): ?>
22
  <?php foreach ($events_group_by_categories as $key_category => $cat_events) { ?>
23
  <ul>
24
- <?php foreach ($cat_events as $key => $event):
 
25
  $event_class = 'event';
26
  ?>
27
- <li class="<?php echo apply_filters('mptt_widget_upcoming_event_class', $event_class) ?>">
28
  <?php
29
 
30
  $disable_url = (bool)$event->post->timetable_disable_url || (bool)$instance['disable_url'];
31
  $url = ($instance['custom_url'] != "") ? $instance['custom_url'] : (($event->post->timetable_custom_url != "") ? $event->post->timetable_custom_url : get_permalink($event->event_id));
32
 
33
- if (!$disable_url) { ?>
34
- <a href="<?php echo $url ?>" title="<?php echo get_the_title($event->event_id) ?>" class="event-link">
35
- <?php }
36
- echo get_the_title($event->event_id);
37
- if (!$disable_url) { ?>
38
  </a><br/>
39
  <?php } ?>
40
  <span class="post-date">
41
  <?php if ($instance['view_settings'] !== 'today' && $instance['view_settings'] !== 'current'): ?><?php echo get_the_title($event->column_id) ?>
42
  <br/>
43
  <?php endif; ?>
44
- <time datetime="<?php echo $event->event_start; ?>" class="timeslot-start"><?php echo date($time_format, strtotime($event->event_start)); ?></time>
 
45
  <?php echo apply_filters('mptt_timeslot_delimiter', ' - '); ?>
46
- <time datetime="<?php echo $event->event_end; ?>" class="timeslot-end"><?php echo date($time_format, strtotime($event->event_end)); ?></time>
 
47
  </span>
48
  </li>
49
  <?php endforeach; ?>
21
  if (!empty($events)): ?>
22
  <?php foreach ($events_group_by_categories as $key_category => $cat_events) { ?>
23
  <ul>
24
+ <?php
25
+ foreach ($cat_events as $key => $event):
26
  $event_class = 'event';
27
  ?>
28
+ <li class="<?php echo esc_attr( apply_filters('mptt_widget_upcoming_event_class', $event_class) ); ?>">
29
  <?php
30
 
31
  $disable_url = (bool)$event->post->timetable_disable_url || (bool)$instance['disable_url'];
32
  $url = ($instance['custom_url'] != "") ? $instance['custom_url'] : (($event->post->timetable_custom_url != "") ? $event->post->timetable_custom_url : get_permalink($event->event_id));
33
 
34
+ if ( ! $disable_url ) { ?>
35
+ <a href="<?php echo esc_url( $url ); ?>" title="<?php echo esc_attr( get_the_title($event->event_id) ); ?>" class="event-link">
36
+ <?php }
37
+ echo esc_html( get_the_title($event->event_id) );
38
+ if ( ! $disable_url ) { ?>
39
  </a><br/>
40
  <?php } ?>
41
  <span class="post-date">
42
  <?php if ($instance['view_settings'] !== 'today' && $instance['view_settings'] !== 'current'): ?><?php echo get_the_title($event->column_id) ?>
43
  <br/>
44
  <?php endif; ?>
45
+ <time datetime="<?php echo esc_attr( $event->event_start ); ?>" class="timeslot-start"><?php
46
+ echo esc_html( date($time_format, strtotime($event->event_start)) ); ?></time>
47
  <?php echo apply_filters('mptt_timeslot_delimiter', ' - '); ?>
48
+ <time datetime="<?php echo esc_attr( $event->event_end ); ?>" class="timeslot-end"><?php
49
+ echo esc_html( date($time_format, strtotime($event->event_end)) ); ?></time>
50
  </span>
51
  </li>
52
  <?php endforeach; ?>
templates/widgets/gallery-list.php CHANGED
@@ -1,6 +1,6 @@
1
- <div class="<?php echo $widget_object->widget_options['classname'] ?>">
2
  <p>
3
- <label for="<?php echo $widget_object->get_field_id('title') ?>"><?php _e('Title', "mp-timetable") ?></label>
4
  <input class="widefat" id="<?php echo $widget_object->get_field_id('title') ?>"
5
  name="<?php echo $widget_object->get_field_name('title') ?>" type="text"
6
  value="<?php echo $instance['title'] ?>">
1
+ <div class="<?php echo esc_attr( $widget_object->widget_options['classname'] ); ?>">
2
  <p>
3
+ <label for="<?php echo esc_attr( $widget_object->get_field_id('title') ); ?>"><?php _e('Title', "mp-timetable") ?></label>
4
  <input class="widefat" id="<?php echo $widget_object->get_field_id('title') ?>"
5
  name="<?php echo $widget_object->get_field_name('title') ?>" type="text"
6
  value="<?php echo $instance['title'] ?>">
templates/widgets/widget-view.php CHANGED
@@ -42,14 +42,14 @@ if (!empty($events)): ?>
42
  $event_class = 'event' . ($widget ? ' mptt-colorized' : '');
43
  ?>
44
 
45
- <li class="<?php echo apply_filters('mptt_widget_upcoming_event_element', $event_class) ?>"
46
  <?php if ($widget): ?> data-type="widget"
47
- data-background-color="<?php echo $background_color ?>"
48
- data-background-hover-color="<?php echo $background_hover_color ?>"
49
- data-color="<?php echo $color ?>"
50
- data-hover-color="<?php echo $hover_color ?>"
51
- data-border-color="<?php echo $instance['item_border_color'] ?>"
52
- data-hover-border-color="<?php echo $instance['hover_item_border_color'] ?>"
53
  <?php
54
  $style .= !empty($instance['item_border_color']) ? ' border-left-color:' . $instance['item_border_color'] . ' ;' : '';
55
  $style .= !empty($background_color) ? ' background:' . $background_color . ' ;' : '';
@@ -67,18 +67,24 @@ if (!empty($events)): ?>
67
  $url = ($instance['custom_url'] != "") ? $instance['custom_url'] : (($event->post->timetable_custom_url != "") ? $event->post->timetable_custom_url : get_permalink($event->event_id)); ?>
68
  <h4 class="event-title">
69
  <?php if (!$disable_url) { ?>
70
- <a href="<?php echo $url ?>" title="<?php echo get_the_title($event->event_id) ?>" class="event-link">
71
  <?php }
72
- echo get_the_title($event->event_id);
73
  if (!$disable_url) { ?>
74
  </a>
75
  <?php } ?>
76
 
77
  </h4>
78
- <?php if ($instance['view_settings'] !== 'today'): ?><p class="column-title"><?php echo get_the_title($event->column_id) ?></p><?php endif; ?>
 
 
79
 
80
  <p class="timeslot">
81
- <span class="timeslot-start"><?php echo date(get_option('time_format'), strtotime($event->event_start)); ?></span><?php echo apply_filters('mptt_timeslot_delimiter', ' - '); ?><span class="timeslot-end"><?php echo date(get_option('time_format'), strtotime($event->event_end)); ?>
 
 
 
 
82
  </p>
83
 
84
  </li>
42
  $event_class = 'event' . ($widget ? ' mptt-colorized' : '');
43
  ?>
44
 
45
+ <li class="<?php echo esc_attr( apply_filters('mptt_widget_upcoming_event_element', $event_class) ); ?>"
46
  <?php if ($widget): ?> data-type="widget"
47
+ data-background-color="<?php echo esc_attr( $background_color ); ?>"
48
+ data-background-hover-color="<?php echo esc_attr( $background_hover_color ); ?>"
49
+ data-color="<?php echo esc_attr( $color ); ?>"
50
+ data-hover-color="<?php echo esc_attr( $hover_color ); ?>"
51
+ data-border-color="<?php echo esc_attr( $instance['item_border_color'] ); ?>"
52
+ data-hover-border-color="<?php echo esc_attr( $instance['hover_item_border_color'] ); ?>"
53
  <?php
54
  $style .= !empty($instance['item_border_color']) ? ' border-left-color:' . $instance['item_border_color'] . ' ;' : '';
55
  $style .= !empty($background_color) ? ' background:' . $background_color . ' ;' : '';
67
  $url = ($instance['custom_url'] != "") ? $instance['custom_url'] : (($event->post->timetable_custom_url != "") ? $event->post->timetable_custom_url : get_permalink($event->event_id)); ?>
68
  <h4 class="event-title">
69
  <?php if (!$disable_url) { ?>
70
+ <a href="<?php echo esc_url( $url ); ?>" title="<?php echo esc_attr( get_the_title($event->event_id) ); ?>" class="event-link">
71
  <?php }
72
+ echo esc_html( get_the_title($event->event_id) );
73
  if (!$disable_url) { ?>
74
  </a>
75
  <?php } ?>
76
 
77
  </h4>
78
+ <?php if ($instance['view_settings'] !== 'today') : ?>
79
+ <p class="column-title"><?php echo esc_html( get_the_title($event->column_id) ); ?></p>
80
+ <?php endif; ?>
81
 
82
  <p class="timeslot">
83
+ <span class="timeslot-start"><?php
84
+ echo esc_html( date(get_option('time_format'), strtotime($event->event_start)) ); ?></span>
85
+ <?php echo apply_filters('mptt_timeslot_delimiter', ' - '); ?>
86
+ <span class="timeslot-end"><?php
87
+ echo esc_html( date(get_option('time_format'), strtotime($event->event_end)) ); ?></span>
88
  </p>
89
 
90
  </li>