My Calendar - Version 3.2.9

Version Description

  • Bug fix: Additional of required fields testing erased error messages generated prior to required fields testing.
  • Bug fix: If an individual occurrence title is edited, event permalinks show the single change on all events.
  • Bug fix: Prev/next event links don't include unique event IDs.
  • Bug fix: Remove irrelevant arguments from prev/next event link generation.
  • Bug fix: Ignore templates if no data passed.
Download this release

Release Info

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

Code changes from version 3.2.8 to 3.2.9

my-calendar-core.php CHANGED
@@ -1550,8 +1550,8 @@ function mc_register_actions() {
1550
  // Filters.
1551
  add_filter( 'post_updated_messages', 'mc_posttypes_messages' );
1552
  add_filter( 'tmp_grunion_allow_editor_view', '__return_false' );
1553
- add_filter( 'next_post_link', 'mc_next_post_link', 10, 5 );
1554
- add_filter( 'previous_post_link', 'mc_previous_post_link', 10, 5 );
1555
 
1556
  // Actions.
1557
  add_action( 'init', 'mc_taxonomies', 0 );
@@ -1573,21 +1573,20 @@ function mc_load_permalinks() {
1573
  /**
1574
  * Change out previous post link for previous event.
1575
  *
1576
- * @param string $output Original link.
1577
- * @param string $format Link anchor format.
1578
- * @param string $link Link permalink format.
1579
- * @param WP_Post $post The adjacent post.
1580
- * @param string $adj next or previous.
1581
  *
1582
  * @return string
1583
  */
1584
- function mc_previous_post_link( $output = '', $format = '', $link = '', $post = false, $adj = false ) {
1585
  if ( is_singular( 'mc-events' ) && isset( $_GET['mc_id'] ) ) {
1586
  $mc_id = (int) $_GET['mc_id'];
1587
  $event = mc_adjacent_event( $mc_id, 'previous' );
1588
- $title = $event['title'];
1589
- $link = $event['details_link'];
1590
- $date = ' <span class="mc-event-date">' . $event['date'] . '</span>';
 
 
1591
 
1592
  $output = str_replace( '%link', '<a href="' . $link . '" rel="next" class="mc-adjacent">' . $title . $date . '</a>', $format );
1593
  }
@@ -1596,24 +1595,22 @@ function mc_previous_post_link( $output = '', $format = '', $link = '', $post =
1596
  }
1597
 
1598
  /**
1599
- * Change out previous post link for previous event.
1600
  *
1601
- * @param string $output Original link.
1602
- * @param string $format Link anchor format.
1603
- * @param string $link Link permalink format.
1604
- * @param WP_Post $post The adjacent post.
1605
- * @param string $adj next or previous.
1606
  *
1607
  * @return string
1608
  */
1609
- function mc_next_post_link( $output = '', $format = '', $link = '', $post = false, $adj = false ) {
1610
- $output = '';
1611
  if ( is_singular( 'mc-events' ) && isset( $_GET['mc_id'] ) ) {
1612
  $mc_id = (int) $_GET['mc_id'];
1613
  $event = mc_adjacent_event( $mc_id, 'next' );
 
1614
  $title = apply_filters( 'the_title', $event['title'], $event['post'] );
1615
- $link = $event['details_link'];
1616
- $date = ' <span class="mc-event-date">' . $event['date'] . '</span>';
 
1617
 
1618
  $output = str_replace( '%link', '<a href="' . $link . '" rel="next" class="mc-adjacent">' . $title . $date . '</a>', $format );
1619
  }
1550
  // Filters.
1551
  add_filter( 'post_updated_messages', 'mc_posttypes_messages' );
1552
  add_filter( 'tmp_grunion_allow_editor_view', '__return_false' );
1553
+ add_filter( 'next_post_link', 'mc_next_post_link', 10, 2 );
1554
+ add_filter( 'previous_post_link', 'mc_previous_post_link', 10, 2 );
1555
 
1556
  // Actions.
1557
  add_action( 'init', 'mc_taxonomies', 0 );
1573
  /**
1574
  * Change out previous post link for previous event.
1575
  *
1576
+ * @param string $output Original link.
1577
+ * @param string $format Link anchor format.
 
 
 
1578
  *
1579
  * @return string
1580
  */
1581
+ function mc_previous_post_link( $output, $format ) {
1582
  if ( is_singular( 'mc-events' ) && isset( $_GET['mc_id'] ) ) {
1583
  $mc_id = (int) $_GET['mc_id'];
1584
  $event = mc_adjacent_event( $mc_id, 'previous' );
1585
+ remove_filter( 'the_title', 'mc_category_icon_title', 10, 2 );
1586
+ $title = apply_filters( 'the_title', $event['title'], $event['post'] );
1587
+ add_filter( 'the_title', 'mc_category_icon_title', 10, 2 );
1588
+ $link = add_query_arg( 'mc_id', $event['dateid'], $event['details_link'] );
1589
+ $date = ' <span class="mc-event-date">' . $event['date'] . '</span>';
1590
 
1591
  $output = str_replace( '%link', '<a href="' . $link . '" rel="next" class="mc-adjacent">' . $title . $date . '</a>', $format );
1592
  }
1595
  }
1596
 
1597
  /**
1598
+ * Change out next post link for next event.
1599
  *
1600
+ * @param string $output Original link.
1601
+ * @param string $format Link anchor format.
 
 
 
1602
  *
1603
  * @return string
1604
  */
1605
+ function mc_next_post_link( $output, $format ) {
 
1606
  if ( is_singular( 'mc-events' ) && isset( $_GET['mc_id'] ) ) {
1607
  $mc_id = (int) $_GET['mc_id'];
1608
  $event = mc_adjacent_event( $mc_id, 'next' );
1609
+ remove_filter( 'the_title', 'mc_category_icon_title', 10, 2 );
1610
  $title = apply_filters( 'the_title', $event['title'], $event['post'] );
1611
+ add_filter( 'the_title', 'mc_category_icon_title', 10, 2 );
1612
+ $link = add_query_arg( 'mc_id', $event['dateid'], $event['details_link'] );
1613
+ $date = ' <span class="mc-event-date">' . $event['date'] . '</span>';
1614
 
1615
  $output = str_replace( '%link', '<a href="' . $link . '" rel="next" class="mc-adjacent">' . $title . $date . '</a>', $format );
1616
  }
my-calendar-event-manager.php CHANGED
@@ -2849,7 +2849,7 @@ function mc_check_data( $action, $post, $i ) {
2849
  // Array: removed before DB insertion.
2850
  'event_categories' => $cats,
2851
  );
2852
- $errors = apply_filters( 'mc_fields_required', '', $submit );
2853
 
2854
  if ( '' === $errors ) {
2855
  $ok = true;
2849
  // Array: removed before DB insertion.
2850
  'event_categories' => $cats,
2851
  );
2852
+ $errors = apply_filters( 'mc_fields_required', $errors, $submit );
2853
 
2854
  if ( '' === $errors ) {
2855
  $ok = true;
my-calendar-output.php CHANGED
@@ -153,7 +153,15 @@ function mc_category_icon_title( $title, $post_id = null ) {
153
  if ( $post_id ) {
154
  $event_id = ( isset( $_GET['mc_id'] ) && is_numeric( $_GET['mc_id'] ) ) ? $_GET['mc_id'] : get_post_meta( $post_id, '_mc_event_id', true );
155
  if ( is_numeric( $event_id ) ) {
156
- $event = mc_get_first_event( $event_id );
 
 
 
 
 
 
 
 
157
  if ( is_object( $event ) && property_exists( $event, 'category_icon' ) ) {
158
  $icon = mc_category_icon( $event );
159
  } else {
@@ -2444,7 +2452,7 @@ function mc_get_current_date( $main_class, $cid, $params ) {
2444
  $c_day = apply_filters( 'mc_filter_day', $shortcode_day, $params );
2445
  }
2446
  $c_day = ( 0 === (int) $c_day ) ? 1 : $c_day; // c_day can't equal 0.
2447
- $current = mktime( 0, 0, 0, $c_month, $c_day, $c_year );
2448
  $c_month = str_pad( $c_month, 2, '0', STR_PAD_LEFT );
2449
 
2450
  return array(
153
  if ( $post_id ) {
154
  $event_id = ( isset( $_GET['mc_id'] ) && is_numeric( $_GET['mc_id'] ) ) ? $_GET['mc_id'] : get_post_meta( $post_id, '_mc_event_id', true );
155
  if ( is_numeric( $event_id ) ) {
156
+ $event = mc_get_event( $event_id );
157
+ if ( ! is_object( $event ) ) {
158
+ $event = mc_get_first_event( $event_id );
159
+ } else {
160
+ $event_title = $event->event_title;
161
+ if ( $event_title !== $title ) {
162
+ $title = $event_title;
163
+ }
164
+ }
165
  if ( is_object( $event ) && property_exists( $event, 'category_icon' ) ) {
166
  $icon = mc_category_icon( $event );
167
  } else {
2452
  $c_day = apply_filters( 'mc_filter_day', $shortcode_day, $params );
2453
  }
2454
  $c_day = ( 0 === (int) $c_day ) ? 1 : $c_day; // c_day can't equal 0.
2455
+ $current = mktime( 0, 0, 0, (int) $c_month, (int) $c_day, (int) $c_year );
2456
  $c_month = str_pad( $c_month, 2, '0', STR_PAD_LEFT );
2457
 
2458
  return array(
my-calendar-templates.php CHANGED
@@ -28,7 +28,10 @@ function mc_draw_template( $array, $template, $type = 'list' ) {
28
  if ( strpos( $template, '{' ) === false ) {
29
  return trim( $template );
30
  }
31
-
 
 
 
32
  foreach ( $array as $key => $value ) {
33
  /**
34
  * I implemented this section due to a *previous* security issue.
28
  if ( strpos( $template, '{' ) === false ) {
29
  return trim( $template );
30
  }
31
+ // If the data passed is not an array or is empty, return empty string.
32
+ if ( ! is_array( $array ) || empty( $array ) ) {
33
+ return '';
34
+ }
35
  foreach ( $array as $key => $value ) {
36
  /**
37
  * I implemented this section due to a *previous* security issue.
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.2.8
21
  */
22
 
23
  /*
@@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
42
  }
43
 
44
  global $mc_version, $wpdb;
45
- $mc_version = '3.2.8';
46
 
47
  define( 'MC_DEBUG', false );
48
 
17
  * License: GPL-2.0+
18
  * License URI: http://www.gnu.org/license/gpl-2.0.txt
19
  * Domain Path: lang
20
+ * Version: 3.2.9
21
  */
22
 
23
  /*
42
  }
43
 
44
  global $mc_version, $wpdb;
45
+ $mc_version = '3.2.9';
46
 
47
  define( 'MC_DEBUG', false );
48
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: calendar, dates, times, event, events, scheduling, schedule, event manager
5
  Requires at least: 4.4
6
  Tested up to: 5.5
7
  Requires PHP: 5.6
8
- Stable tag: 3.2.8
9
  Text domain: my-calendar
10
  License: GPLv2 or later
11
 
@@ -52,6 +52,7 @@ Do you need to sell tickets for events? [Use My Tickets](https://wordpress.org/p
52
  > * Advanced search features
53
  > * Responsive mode
54
  > * Import events from .ics or .csv formats via file or URL.
 
55
 
56
  = Translations =
57
 
@@ -83,6 +84,14 @@ Translating my plug-ins is always appreciated. Visit <a href="https://translate.
83
 
84
  == Changelog ==
85
 
 
 
 
 
 
 
 
 
86
  = 3.2.8 =
87
 
88
  * Bug fix: Extraneous screen-reader-text summary generated in event views.
5
  Requires at least: 4.4
6
  Tested up to: 5.5
7
  Requires PHP: 5.6
8
+ Stable tag: 3.2.9
9
  Text domain: my-calendar
10
  License: GPLv2 or later
11
 
52
  > * Advanced search features
53
  > * Responsive mode
54
  > * Import events from .ics or .csv formats via file or URL.
55
+ > * REST API support for sharing events between multiple sites.
56
 
57
  = Translations =
58
 
84
 
85
  == Changelog ==
86
 
87
+ = 3.2.9 =
88
+
89
+ * Bug fix: Additional of required fields testing erased error messages generated prior to required fields testing.
90
+ * Bug fix: If an individual occurrence title is edited, event permalinks show the single change on all events.
91
+ * Bug fix: Prev/next event links don't include unique event IDs.
92
+ * Bug fix: Remove irrelevant arguments from prev/next event link generation.
93
+ * Bug fix: Ignore templates if no data passed.
94
+
95
  = 3.2.8 =
96
 
97
  * Bug fix: Extraneous screen-reader-text summary generated in event views.