My Calendar - Version 3.3.11

Version Description

  • Bug fix: Modifying a category didn't refresh the icon SVG for that category.
  • Bug fix: Contextual help should be viewable with 'view help' capability.
  • Bug fix: Allow img in event title templates.
  • Bug fix: 'all' category limit could be cast to an integer, breaking links.
  • Change: text changes to location select label for clarification of purpose.
  • Change: allow mc_bulk_actions() to take a second argument with events to modify.
Download this release

Release Info

Developer joedolson
Plugin Icon 128x128 My Calendar
Version 3.3.11
Comparing to
See all releases

Code changes from version 3.3.10 to 3.3.11

includes/general-utilities.php CHANGED
@@ -109,7 +109,7 @@ function mc_add_inner_box() {
109
  */
110
  function mc_strip_tags() {
111
 
112
- return apply_filters( 'mc_strip_tags', '<strong><em><i><b><span><br><a><time>' );
113
  }
114
 
115
  /**
109
  */
110
  function mc_strip_tags() {
111
 
112
+ return apply_filters( 'mc_strip_tags', '<strong><em><i><b><span><br><a><time><img>' );
113
  }
114
 
115
  /**
my-calendar-categories.php CHANGED
@@ -285,9 +285,10 @@ function mc_update_category_relationships( $cats, $event_id ) {
285
  */
286
  function mc_update_cat( $category ) {
287
  global $wpdb;
 
288
  $formats = array( '%s', '%s', '%s', '%d', '%d', '%d' );
289
  $where = array(
290
- 'category_id' => (int) $_POST['category_id'],
291
  );
292
  $cat_name = strip_tags( $category['category_name'] );
293
  $term_exists = term_exists( $cat_name, 'mc-event-category' );
@@ -303,6 +304,8 @@ function mc_update_cat( $category ) {
303
  $term = $term->term_id;
304
  }
305
  $category['category_term'] = $term;
 
 
306
 
307
  $result = $wpdb->update( my_calendar_categories_table(), $category, $where, $formats, '%d' );
308
 
@@ -1204,6 +1207,16 @@ function mc_get_img( $file, $is_custom = false ) {
1204
  return $image;
1205
  }
1206
 
 
 
 
 
 
 
 
 
 
 
1207
  /**
1208
  * Produce filepath & name or full img HTML for specific category's icon
1209
  *
285
  */
286
  function mc_update_cat( $category ) {
287
  global $wpdb;
288
+ $category_id = (int) $_POST['category_id'];
289
  $formats = array( '%s', '%s', '%s', '%d', '%d', '%d' );
290
  $where = array(
291
+ 'category_id' => $category_id,
292
  );
293
  $cat_name = strip_tags( $category['category_name'] );
294
  $term_exists = term_exists( $cat_name, 'mc-event-category' );
304
  $term = $term->term_id;
305
  }
306
  $category['category_term'] = $term;
307
+ // Delete category icons from database so they will be updated.
308
+ mc_delete_category_icon( $category_id );
309
 
310
  $result = $wpdb->update( my_calendar_categories_table(), $category, $where, $formats, '%d' );
311
 
1207
  return $image;
1208
  }
1209
 
1210
+ /**
1211
+ * Delete category icon from storage. Enables replacement of stored icon if category is modified.
1212
+ *
1213
+ * @param int $category_id Category ID.
1214
+ */
1215
+ function mc_delete_category_icon( $category_id ) {
1216
+ delete_option( 'mc_category_icon_category_' . $category_id );
1217
+ delete_option( 'mc_category_icon_event_' . $category_id );
1218
+ }
1219
+
1220
  /**
1221
  * Produce filepath & name or full img HTML for specific category's icon
1222
  *
my-calendar-event-editor.php CHANGED
@@ -1552,19 +1552,20 @@ function mc_event_location_dropdown_block( $data ) {
1552
  if ( $count > apply_filters( 'mc_convert_locations_select_to_autocomplete', 90 ) ) {
1553
  $autocomplete = true;
1554
  }
1555
- if ( 0 !== $count ) {
1556
- $fields .= '<label for="l_preset">' . __( 'Choose location:', 'my-calendar' ) . '</label>';
1557
- if ( is_object( $data ) ) {
1558
- $selected = '';
1559
- if ( property_exists( $data, 'event_location' ) ) {
1560
- $event_location = $data->event_location;
1561
- }
1562
  }
 
 
 
1563
  if ( ! $autocomplete ) {
1564
  $locs = mc_get_locations( 'select-locations' );
 
1565
  $fields .= '
1566
  <select name="location_preset" id="l_preset" aria-describedby="mc-current-location">
1567
- <option value="none">' . __( 'No location', 'my-calendar' ) . '</option>';
1568
  foreach ( $locs as $loc ) {
1569
  if ( is_object( $loc ) ) {
1570
  $base_loc = strip_tags( stripslashes( $loc->location_label ), mc_strip_tags() );
1552
  if ( $count > apply_filters( 'mc_convert_locations_select_to_autocomplete', 90 ) ) {
1553
  $autocomplete = true;
1554
  }
1555
+ if ( is_object( $data ) ) {
1556
+ $selected = '';
1557
+ if ( property_exists( $data, 'event_location' ) ) {
1558
+ $event_location = $data->event_location;
 
 
 
1559
  }
1560
+ }
1561
+ if ( 0 !== $count ) {
1562
+ $fields .= ( $event_location ) ? '<label for="l_preset">' . __( 'Change location:', 'my-calendar' ) . '</label>' : '<label for="l_preset">' . __( 'Choose location:', 'my-calendar' ) . '</label>';
1563
  if ( ! $autocomplete ) {
1564
  $locs = mc_get_locations( 'select-locations' );
1565
+ $text = ( $event_location ) ? __( 'No change', 'my-calendar' ) : __( 'No location', 'my-calendar' );
1566
  $fields .= '
1567
  <select name="location_preset" id="l_preset" aria-describedby="mc-current-location">
1568
+ <option value="none">' . $text . '</option>';
1569
  foreach ( $locs as $loc ) {
1570
  if ( is_object( $loc ) ) {
1571
  $base_loc = strip_tags( stripslashes( $loc->location_label ), mc_strip_tags() );
my-calendar-event-manager.php CHANGED
@@ -17,12 +17,13 @@ if ( ! defined( 'ABSPATH' ) ) {
17
  * Handle a bulk action.
18
  *
19
  * @param string $action type of action.
 
20
  *
21
  * @return array bulk action details.
22
  */
23
- function mc_bulk_action( $action ) {
24
  global $wpdb;
25
- $events = $_POST['mass_edit'];
26
  $i = 0;
27
  $total = 0;
28
  $ids = array();
17
  * Handle a bulk action.
18
  *
19
  * @param string $action type of action.
20
+ * @param array $events Optional. Array of event IDs to act on.
21
  *
22
  * @return array bulk action details.
23
  */
24
+ function mc_bulk_action( $action, $events = array() ) {
25
  global $wpdb;
26
+ $events = ( empty( $events ) ) ? $_POST['mass_edit'] : $events;
27
  $i = 0;
28
  $total = 0;
29
  $ids = array();
my-calendar-limits.php CHANGED
@@ -48,7 +48,7 @@ function mc_prepare_search_query( $query ) {
48
  * @return string SQL modifiers.
49
  */
50
  function mc_select_category( $category, $type = 'event', $group = 'events' ) {
51
- if ( '' === trim( $category ) ) {
52
  return '';
53
  }
54
  $category = urldecode( $category );
48
  * @return string SQL modifiers.
49
  */
50
  function mc_select_category( $category, $type = 'event', $group = 'events' ) {
51
+ if ( ! $category || 'all' === $category ) {
52
  return '';
53
  }
54
  $category = urldecode( $category );
my-calendar.php CHANGED
@@ -17,7 +17,7 @@
17
  * License: GPL-2.0+
18
  * License URI: http://www.gnu.org/license/gpl-2.0.txt
19
  * Domain Path: lang
20
- * Version: 3.3.10
21
  */
22
 
23
  /*
@@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
42
  }
43
 
44
  global $mc_version, $wpdb;
45
- $mc_version = '3.3.10';
46
 
47
  define( 'MC_DEBUG', false );
48
 
@@ -445,7 +445,7 @@ function my_calendar_menu() {
445
  add_submenu_page( 'my-calendar', __( 'My Calendar Shortcode Generator', 'my-calendar' ), __( 'Shortcodes', 'my-calendar' ), 'mc_view_help', 'my-calendar-shortcodes', 'my_calendar_shortcodes' );
446
  add_submenu_page( 'my-calendar', __( 'My Calendar Help', 'my-calendar' ), __( 'Help', 'my-calendar' ), 'mc_view_help', 'my-calendar-help', 'my_calendar_help' );
447
  // Null submenu parent prevents this from appearing in the admin menu.
448
- add_submenu_page( null, __( 'My Calendar Contextual Help', 'my-calendar' ), __( 'My Calendar Contextual Help', 'my-calendar' ), 'manage_options', 'mc-contextual-help', 'mc_print_contextual_help' );
449
  }
450
  if ( function_exists( 'mcs_submissions' ) ) {
451
  $capability = 'manage_options';
17
  * License: GPL-2.0+
18
  * License URI: http://www.gnu.org/license/gpl-2.0.txt
19
  * Domain Path: lang
20
+ * Version: 3.3.11
21
  */
22
 
23
  /*
42
  }
43
 
44
  global $mc_version, $wpdb;
45
+ $mc_version = '3.3.11';
46
 
47
  define( 'MC_DEBUG', false );
48
 
445
  add_submenu_page( 'my-calendar', __( 'My Calendar Shortcode Generator', 'my-calendar' ), __( 'Shortcodes', 'my-calendar' ), 'mc_view_help', 'my-calendar-shortcodes', 'my_calendar_shortcodes' );
446
  add_submenu_page( 'my-calendar', __( 'My Calendar Help', 'my-calendar' ), __( 'Help', 'my-calendar' ), 'mc_view_help', 'my-calendar-help', 'my_calendar_help' );
447
  // Null submenu parent prevents this from appearing in the admin menu.
448
+ add_submenu_page( null, __( 'My Calendar Contextual Help', 'my-calendar' ), __( 'My Calendar Contextual Help', 'my-calendar' ), 'mc_view_help', 'mc-contextual-help', 'mc_print_contextual_help' );
449
  }
450
  if ( function_exists( 'mcs_submissions' ) ) {
451
  $capability = 'manage_options';
readme.txt CHANGED
@@ -6,7 +6,7 @@ Requires at least: 4.4
6
  Tested up to: 5.9
7
  Requires PHP: 7.0
8
  Text domain: my-calendar
9
- Stable tag: 3.3.10
10
  License: GPLv2 or later
11
 
12
  Accessible WordPress event calendar plugin. Show events from multiple calendars on pages, in posts, or in widgets.
@@ -84,6 +84,15 @@ Translating my plugins is always appreciated. Visit <a href="https://translate.w
84
 
85
  == Changelog ==
86
 
 
 
 
 
 
 
 
 
 
87
  = 3.3.10 =
88
 
89
  * Bug fix: aria-current not rendered on event manager filters.
6
  Tested up to: 5.9
7
  Requires PHP: 7.0
8
  Text domain: my-calendar
9
+ Stable tag: 3.3.11
10
  License: GPLv2 or later
11
 
12
  Accessible WordPress event calendar plugin. Show events from multiple calendars on pages, in posts, or in widgets.
84
 
85
  == Changelog ==
86
 
87
+ = 3.3.11 =
88
+
89
+ * Bug fix: Modifying a category didn't refresh the icon SVG for that category.
90
+ * Bug fix: Contextual help should be viewable with 'view help' capability.
91
+ * Bug fix: Allow img in event title templates.
92
+ * Bug fix: 'all' category limit could be cast to an integer, breaking links.
93
+ * Change: text changes to location select label for clarification of purpose.
94
+ * Change: allow mc_bulk_actions() to take a second argument with events to modify.
95
+
96
  = 3.3.10 =
97
 
98
  * Bug fix: aria-current not rendered on event manager filters.