My Calendar - Version 3.3.10

Version Description

  • Bug fix: aria-current not rendered on event manager filters.
  • Bug fix: published filter not marked as current by default.
  • Bug fix: Cache allowed sites for CORS headers on multisite networks.
  • Bug fix: fread error if no stylesheet defined.
  • Bug fix: Extra closing div in single-day view.
  • Bug fix: Better support for local user time.
  • Change: Wrapper function for My Calendar time format: mc_time_format()
Download this release

Release Info

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

Code changes from version 3.3.9 to 3.3.10

includes/event-utilities.php CHANGED
@@ -53,8 +53,8 @@ function mc_test_occurrence_overlap( $data, $return = false ) {
53
  if ( my_calendar_date_xcomp( $check['occur_begin'], $data->event_end . ' ' . $data->event_endtime ) ) {
54
  $warning = "<div class='error'><span class='problem-icon dashicons dashicons-performance' aria-hidden='true'></span> <p><strong>" . __( 'Event hidden from public view.', 'my-calendar' ) . '</strong> ' . __( 'This event ends after the next occurrence begins. Events must end <strong>before</strong> the next occurrence begins.', 'my-calendar' ) . '</p><p>';
55
  $enddate = date_i18n( mc_date_format(), strtotime( $data->event_end ) );
56
- $endtime = mc_date( get_option( 'mc_time_format' ), strtotime( $data->event_endtime ), false );
57
- $begin = date_i18n( mc_date_format(), strtotime( $check['occur_begin'] ) ) . ' ' . mc_date( get_option( 'mc_time_format' ), strtotime( $check['occur_begin'] ), false );
58
  // Translators: End date, end time, beginning of next event.
59
  $warning .= sprintf( __( 'Event end date: <strong>%1$s %2$s</strong>. Next occurrence starts: <strong>%3$s</strong>', 'my-calendar' ), $enddate, $endtime, $begin ) . '</p></div>';
60
  update_post_meta( $data->event_post, '_occurrence_overlap', 'false' );
53
  if ( my_calendar_date_xcomp( $check['occur_begin'], $data->event_end . ' ' . $data->event_endtime ) ) {
54
  $warning = "<div class='error'><span class='problem-icon dashicons dashicons-performance' aria-hidden='true'></span> <p><strong>" . __( 'Event hidden from public view.', 'my-calendar' ) . '</strong> ' . __( 'This event ends after the next occurrence begins. Events must end <strong>before</strong> the next occurrence begins.', 'my-calendar' ) . '</p><p>';
55
  $enddate = date_i18n( mc_date_format(), strtotime( $data->event_end ) );
56
+ $endtime = mc_date( mc_time_format(), strtotime( $data->event_endtime ), false );
57
+ $begin = date_i18n( mc_date_format(), strtotime( $check['occur_begin'] ) ) . ' ' . mc_date( mc_time_format(), strtotime( $check['occur_begin'] ), false );
58
  // Translators: End date, end time, beginning of next event.
59
  $warning .= sprintf( __( 'Event end date: <strong>%1$s %2$s</strong>. Next occurrence starts: <strong>%3$s</strong>', 'my-calendar' ), $enddate, $endtime, $begin ) . '</p></div>';
60
  update_post_meta( $data->event_post, '_occurrence_overlap', 'false' );
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>' );
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>' );
113
  }
114
 
115
  /**
includes/kses.php CHANGED
@@ -373,6 +373,9 @@ function mc_kses_elements() {
373
  'value' => array(),
374
  'required' => array(),
375
  ),
 
 
 
376
  );
377
 
378
  return $elements;
373
  'value' => array(),
374
  'required' => array(),
375
  ),
376
+ 'time' => array(
377
+ 'data-label' => array(),
378
+ ),
379
  );
380
 
381
  return $elements;
my-calendar-core.php CHANGED
@@ -1523,21 +1523,22 @@ function mc_scripts() {
1523
  }
1524
 
1525
 
1526
- add_filter( 'mc_time_format', 'mc_time_format', 10, 1 );
1527
  /**
1528
- * Default time format is 'h:i A' (standard US time format).
1529
- * Pass a string using pickadate.time rules: http://amsul.ca/pickadate.js/time/#formatting-rules.
1530
  *
1531
- * @param string $format Default time format string.
1532
- *
1533
- * @return string new format.
1534
  */
1535
- function mc_time_format( $format ) {
1536
- if ( 'G:i' === get_option( 'mc_time_format' ) || 'H:i' === get_option( 'mc_time_format' ) || 'G:i' === get_option( 'time_format' ) || 'H:i' === get_option( 'time_format' ) ) {
1537
- return 'H:i'; // European 24-hour format.
 
 
 
 
 
1538
  }
1539
 
1540
- return $format;
1541
  }
1542
 
1543
  /**
@@ -2166,13 +2167,20 @@ function mc_update_notice() {
2166
  * Allow CORS from subsites in multisite networks in subdomain setups.
2167
  */
2168
  function mc_setup_cors_access() {
2169
- $origin = str_replace( array( 'http://', 'https://' ), '', get_http_origin() );
2170
- $sites = ( function_exists( 'get_sites' ) ) ? get_sites() : array();
2171
- $allowed = apply_filters( 'mc_setup_allowed_sites', array(), $origin );
2172
- if ( ! empty( $sites ) ) {
2173
- foreach ( $sites as $site ) {
2174
- $allowed[] = str_replace( array( 'http://', 'https://' ), '', get_home_url( $site->blog_id ) );
 
 
 
 
 
 
2175
  }
 
2176
  }
2177
  if ( $origin && is_array( $allowed ) && in_array( $origin, $allowed, true ) ) {
2178
  header( 'Access-Control-Allow-Origin: ' . esc_url_raw( $origin ) );
1523
  }
1524
 
1525
 
 
1526
  /**
1527
+ * Get the My Calendar time format.
 
1528
  *
1529
+ * @return string format.
 
 
1530
  */
1531
+ function mc_time_format() {
1532
+ $mc_time_format = get_option( 'mc_time_format', '' );
1533
+ $time_format = get_option( 'time_format', '' );
1534
+ if ( '' === $mc_time_format ) {
1535
+ $mc_time_format = $time_format;
1536
+ }
1537
+ if ( '' === $mc_time_format ) {
1538
+ $mc_time_format = 'h:i a';
1539
  }
1540
 
1541
+ return $mc_time_format;
1542
  }
1543
 
1544
  /**
2167
  * Allow CORS from subsites in multisite networks in subdomain setups.
2168
  */
2169
  function mc_setup_cors_access() {
2170
+ $cache = get_transient( 'mc_allowed_origins' );
2171
+ $origin = str_replace( array( 'http://', 'https://' ), '', get_http_origin() );
2172
+
2173
+ if ( $cache ) {
2174
+ $allowed = $cache;
2175
+ } else {
2176
+ $sites = ( function_exists( 'get_sites' ) ) ? get_sites() : array();
2177
+ $allowed = apply_filters( 'mc_setup_allowed_sites', array(), $origin );
2178
+ if ( ! empty( $sites ) ) {
2179
+ foreach ( $sites as $site ) {
2180
+ $allowed[] = str_replace( array( 'http://', 'https://' ), '', get_home_url( $site->blog_id ) );
2181
+ }
2182
  }
2183
+ set_transient( 'mc_allowed_origins', $allowed, MONTH_IN_SECONDS );
2184
  }
2185
  if ( $origin && is_array( $allowed ) && in_array( $origin, $allowed, true ) ) {
2186
  header( 'Access-Control-Allow-Origin: ' . esc_url_raw( $origin ) );
my-calendar-event-editor.php CHANGED
@@ -2268,7 +2268,7 @@ function mc_standard_datetime_input( $form, $has_data, $data, $instance, $contex
2268
  $aria = '';
2269
  if ( '00:00' !== $max || '00:00' !== $min ) {
2270
  // Translators: starting time, ending time.
2271
- $range = '<p id="mc_time_range_allowed">' . sprintf( __( 'Times must be between %1$s and %2$s', 'my-calendar' ), mc_date( get_option( 'mc_time_format' ), strtotime( $min ) ), mc_date( get_option( 'mc_time_format' ), strtotime( $max ) ) ) . '</p>';
2272
  $aria = ' aria-describedby="mc_time_range_allowed"';
2273
  $append = '<span class="validity"><span class="dashicons dashicons-no" aria-hidden="true"></span>' . __( 'Invalid time', 'my-calendar' ) . '</span>';
2274
  }
@@ -2587,7 +2587,7 @@ function mc_grouped_events( $id, $template = '' ) {
2587
  $event = $first->occur_event_id;
2588
  $current = '<a href="' . admin_url( 'admin.php?page=my-calendar' ) . '&amp;mode=edit&amp;event_id=' . $event . '">';
2589
  $close = '</a>';
2590
- $begin = date_i18n( mc_date_format(), strtotime( $first->occur_begin ) ) . ', ' . mc_date( get_option( 'mc_time_format' ), strtotime( $first->occur_begin ), false );
2591
  $array = array(
2592
  'current' => $current,
2593
  'begin' => $begin,
2268
  $aria = '';
2269
  if ( '00:00' !== $max || '00:00' !== $min ) {
2270
  // Translators: starting time, ending time.
2271
+ $range = '<p id="mc_time_range_allowed">' . sprintf( __( 'Times must be between %1$s and %2$s', 'my-calendar' ), mc_date( mc_time_format(), strtotime( $min ) ), mc_date( mc_time_format(), strtotime( $max ) ) ) . '</p>';
2272
  $aria = ' aria-describedby="mc_time_range_allowed"';
2273
  $append = '<span class="validity"><span class="dashicons dashicons-no" aria-hidden="true"></span>' . __( 'Invalid time', 'my-calendar' ) . '</span>';
2274
  }
2587
  $event = $first->occur_event_id;
2588
  $current = '<a href="' . admin_url( 'admin.php?page=my-calendar' ) . '&amp;mode=edit&amp;event_id=' . $event . '">';
2589
  $close = '</a>';
2590
+ $begin = date_i18n( mc_date_format(), strtotime( $first->occur_begin ) ) . ', ' . mc_date( mc_time_format(), strtotime( $first->occur_begin ), false );
2591
  $array = array(
2592
  'current' => $current,
2593
  'begin' => $begin,
my-calendar-event-manager.php CHANGED
@@ -568,10 +568,10 @@ function mc_list_events() {
568
  }
569
  $status_links = mc_status_links( $allow_filters );
570
  $search_text = ( isset( $_POST['mcs'] ) ) ? $_POST['mcs'] : '';
571
- echo wp_kses_post( $filtered );
572
  ?>
573
  <div class="mc-admin-header">
574
- <?php echo wp_kses_post( $status_links ); ?>
575
  <div class='mc-search'>
576
  <form action="<?php echo esc_url( add_query_arg( $_GET, admin_url( 'admin.php' ) ) ); ?>" method="post">
577
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'my-calendar-nonce' ); ?>"/>
@@ -770,7 +770,7 @@ function mc_list_events() {
770
  <td>
771
  <?php
772
  if ( '23:59:59' !== $event->event_endtime ) {
773
- $event_time = date_i18n( get_option( 'mc_time_format' ), mc_strtotime( $event->event_time ) );
774
  } else {
775
  $event_time = mc_notime_label( $event );
776
  }
@@ -814,8 +814,7 @@ function mc_list_events() {
814
  <div class='mc-admin-footer'>
815
  <?php
816
  $status_links = mc_status_links( $allow_filters );
817
- echo wp_kses_post( $status_links );
818
- echo wp_kses_post( $filtered );
819
  ?>
820
  <div class='mc-search'>
821
  <form action="<?php echo esc_url( add_query_arg( $_GET, admin_url( 'admin.php' ) ) ); ?>" method="post">
568
  }
569
  $status_links = mc_status_links( $allow_filters );
570
  $search_text = ( isset( $_POST['mcs'] ) ) ? $_POST['mcs'] : '';
571
+ echo wp_kses( $filtered, mc_kses_elements() );
572
  ?>
573
  <div class="mc-admin-header">
574
+ <?php echo wp_kses( $status_links, mc_kses_elements() ); ?>
575
  <div class='mc-search'>
576
  <form action="<?php echo esc_url( add_query_arg( $_GET, admin_url( 'admin.php' ) ) ); ?>" method="post">
577
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'my-calendar-nonce' ); ?>"/>
770
  <td>
771
  <?php
772
  if ( '23:59:59' !== $event->event_endtime ) {
773
+ $event_time = date_i18n( mc_time_format(), mc_strtotime( $event->event_time ) );
774
  } else {
775
  $event_time = mc_notime_label( $event );
776
  }
814
  <div class='mc-admin-footer'>
815
  <?php
816
  $status_links = mc_status_links( $allow_filters );
817
+ echo wp_kses( $status_links . $filtered, mc_kses_elements() );
 
818
  ?>
819
  <div class='mc-search'>
820
  <form action="<?php echo esc_url( add_query_arg( $_GET, admin_url( 'admin.php' ) ) ); ?>" method="post">
my-calendar-events.php CHANGED
@@ -968,9 +968,9 @@ function mc_admin_instances( $id, $occur = false ) {
968
  if ( ( ( $end + 1 ) - $start ) === DAY_IN_SECONDS || ( $end - $start ) === DAY_IN_SECONDS ) {
969
  $time = '';
970
  } elseif ( ( $end - $start ) <= HOUR_IN_SECONDS ) {
971
- $time = mc_date( get_option( 'mc_time_format' ), $start );
972
  } else {
973
- $time = mc_date( get_option( 'mc_time_format' ), $start ) . '-' . mc_date( get_option( 'mc_time_format' ), $end );
974
  }
975
  $date = date_i18n( mc_date_format(), mc_date( '', $start ) );
976
  $date = "<span id='occur_date_$result->occur_id'>" . $date . '<br />' . $time . '</span>';
@@ -1199,7 +1199,7 @@ function mc_status_links( $allow_filters ) {
1199
  // Translators: Number of total events.
1200
  $all_text = sprintf( __( 'All (%d)', 'my-calendar' ), $all );
1201
 
1202
- $pub_attributes = ( isset( $_GET['limit'] ) && 'published' === $_GET['limit'] ) ? ' aria-current="true"' : '';
1203
  // Translators: Number of total events.
1204
  $pub_text = sprintf( __( 'Published (%d)', 'my-calendar' ), $counts['published'] );
1205
 
968
  if ( ( ( $end + 1 ) - $start ) === DAY_IN_SECONDS || ( $end - $start ) === DAY_IN_SECONDS ) {
969
  $time = '';
970
  } elseif ( ( $end - $start ) <= HOUR_IN_SECONDS ) {
971
+ $time = mc_date( mc_time_format(), $start );
972
  } else {
973
+ $time = mc_date( mc_time_format(), $start ) . '-' . mc_date( mc_time_format(), $end );
974
  }
975
  $date = date_i18n( mc_date_format(), mc_date( '', $start ) );
976
  $date = "<span id='occur_date_$result->occur_id'>" . $date . '<br />' . $time . '</span>';
1199
  // Translators: Number of total events.
1200
  $all_text = sprintf( __( 'All (%d)', 'my-calendar' ), $all );
1201
 
1202
+ $pub_attributes = ( isset( $_GET['limit'] ) && 'published' === $_GET['limit'] || ! isset( $_GET['limit'] ) ) ? ' aria-current="true"' : '';
1203
  // Translators: Number of total events.
1204
  $pub_text = sprintf( __( 'Published (%d)', 'my-calendar' ), $counts['published'] );
1205
 
my-calendar-group-manager.php CHANGED
@@ -929,7 +929,7 @@ function mc_list_groups() {
929
  <td><?php echo strip_tags( stripslashes( $event->event_label ) ); ?></td>
930
  <?php
931
  if ( '23:59:59' !== $event->event_endtime ) {
932
- $event_time = date_i18n( get_option( 'mc_time_format' ), strtotime( $event->event_time ) );
933
  } else {
934
  $event_time = mc_notime_label( $event );
935
  }
929
  <td><?php echo strip_tags( stripslashes( $event->event_label ) ); ?></td>
930
  <?php
931
  if ( '23:59:59' !== $event->event_endtime ) {
932
+ $event_time = date_i18n( mc_time_format(), strtotime( $event->event_time ) );
933
  } else {
934
  $event_time = mc_notime_label( $event );
935
  }
my-calendar-location-manager.php CHANGED
@@ -111,7 +111,7 @@ function mc_clean_duplicate_locations() {
111
  die( 'Security check failed' );
112
  }
113
  $locations = $_POST['mass_edit'];
114
- $replace = $_POST['mass_replace_id'];
115
  $location = mc_get_location( $replace );
116
  if ( ! $location ) {
117
  // If this isn't a valid location, don't continue.
@@ -122,6 +122,10 @@ function mc_clean_duplicate_locations() {
122
  $total = 0;
123
  $deleted = array();
124
  foreach ( $locations as $value ) {
 
 
 
 
125
  $total = count( $locations );
126
  $result = mc_delete_location( $value, 'bool' );
127
  if ( ! $result ) {
111
  die( 'Security check failed' );
112
  }
113
  $locations = $_POST['mass_edit'];
114
+ $replace = absint( $_POST['mass_replace_id'] );
115
  $location = mc_get_location( $replace );
116
  if ( ! $location ) {
117
  // If this isn't a valid location, don't continue.
122
  $total = 0;
123
  $deleted = array();
124
  foreach ( $locations as $value ) {
125
+ // If the replacement location is checked, ignore it.
126
+ if ( (int) $replace === (int) $value ) {
127
+ continue;
128
+ }
129
  $total = count( $locations );
130
  $result = mc_delete_location( $value, 'bool' );
131
  if ( ! $result ) {
my-calendar-output.php CHANGED
@@ -23,7 +23,7 @@ if ( ! defined( 'ABSPATH' ) ) {
23
  */
24
  function mc_time_html( $e, $type ) {
25
  $date_format = mc_date_format();
26
- $time_format = get_option( 'mc_time_format' );
27
  $start = mc_date( 'Y-m-d', strtotime( $e->occur_begin ), false );
28
  $end = mc_date( 'Y-m-d', strtotime( $e->occur_end ), false );
29
  $has_time = ( '00:00:00' !== $e->event_time && '' !== $e->event_time ) ? true : false;
@@ -1322,7 +1322,7 @@ function my_calendar( $args ) {
1322
  <div id="mc-day-' . $id . '" class="mc-day ' . $dateclass . ' ' . $events_class . '">
1323
  ' . "$mc_events
1324
  </div>
1325
- </div>";
1326
  } else {
1327
  // If showing multiple months, figure out how far we're going.
1328
  $months = ( 'week' === $params['time'] ) ? 1 : $show_months;
@@ -1479,7 +1479,9 @@ function my_calendar( $args ) {
1479
  $end = ( 'table' === $table ) ? "\n</tbody>\n</table>" : "</div></$table>";
1480
  $body .= ( 'list' === $params['format'] ) ? "\n</ul>" : $end;
1481
  }
1482
- $body .= '</div>' . $bottom;
 
 
1483
  }
1484
  // The actual printing is done by the shortcode function.
1485
  $body .= apply_filters( 'mc_after_calendar', '', $args );
23
  */
24
  function mc_time_html( $e, $type ) {
25
  $date_format = mc_date_format();
26
+ $time_format = mc_time_format();
27
  $start = mc_date( 'Y-m-d', strtotime( $e->occur_begin ), false );
28
  $end = mc_date( 'Y-m-d', strtotime( $e->occur_end ), false );
29
  $has_time = ( '00:00:00' !== $e->event_time && '' !== $e->event_time ) ? true : false;
1322
  <div id="mc-day-' . $id . '" class="mc-day ' . $dateclass . ' ' . $events_class . '">
1323
  ' . "$mc_events
1324
  </div>
1325
+ </div><!-- .mc-content -->";
1326
  } else {
1327
  // If showing multiple months, figure out how far we're going.
1328
  $months = ( 'week' === $params['time'] ) ? 1 : $show_months;
1479
  $end = ( 'table' === $table ) ? "\n</tbody>\n</table>" : "</div></$table>";
1480
  $body .= ( 'list' === $params['format'] ) ? "\n</ul>" : $end;
1481
  }
1482
+ // For clarity, day closer is appended above.
1483
+ $body .= ( 'day' === $params['time'] ) ? '' : '</div><!-- .mc-content -->';
1484
+ $body .= $bottom;
1485
  }
1486
  // The actual printing is done by the shortcode function.
1487
  $body .= apply_filters( 'mc_after_calendar', '', $args );
my-calendar-settings.php CHANGED
@@ -762,7 +762,7 @@ function mc_remote_db() {
762
  <ul>
763
  <?php
764
  $month_format = ( '' === get_option( 'mc_month_format', '' ) ) ? date_i18n( 'F Y' ) : date_i18n( get_option( 'mc_month_format' ) );
765
- $time_format = ( '' === get_option( 'mc_time_format', '' ) ) ? date_i18n( get_option( 'time_format' ) ) : date_i18n( get_option( 'mc_time_format' ) );
766
  $week_format = ( '' === get_option( 'mc_week_format', '' ) ) ? date_i18n( 'M j, \'y' ) : date_i18n( get_option( 'mc_week_format' ) );
767
  $date_format = ( '' === get_option( 'mc_date_format', '' ) ) ? date_i18n( get_option( 'date_format' ) ) : date_i18n( get_option( 'mc_date_format' ) );
768
  $tomorrow = date( 'j' ) + 1; // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
762
  <ul>
763
  <?php
764
  $month_format = ( '' === get_option( 'mc_month_format', '' ) ) ? date_i18n( 'F Y' ) : date_i18n( get_option( 'mc_month_format' ) );
765
+ $time_format = date_i18n( mc_time_format() );
766
  $week_format = ( '' === get_option( 'mc_week_format', '' ) ) ? date_i18n( 'M j, \'y' ) : date_i18n( get_option( 'mc_week_format' ) );
767
  $date_format = ( '' === get_option( 'mc_date_format', '' ) ) ? date_i18n( get_option( 'date_format' ) ) : date_i18n( get_option( 'mc_date_format' ) );
768
  $tomorrow = date( 'j' ) + 1; // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
my-calendar-styles.php CHANGED
@@ -378,12 +378,12 @@ function mc_get_style_path( $filename = false, $type = 'path' ) {
378
  */
379
  function mc_default_style( $filename = false, $return = 'content' ) {
380
  if ( ! $filename ) {
381
- $mc_css_file = get_option( 'mc_css_file' );
382
  } else {
383
- $mc_css_file = $filename;
384
  }
385
  $mc_current_file = dirname( __FILE__ ) . '/templates/' . $mc_css_file;
386
- if ( file_exists( $mc_current_file ) ) {
387
  $f = fopen( $mc_current_file, 'r' );
388
  $file = fread( $f, filesize( $mc_current_file ) );
389
  $mc_current_style = $file;
378
  */
379
  function mc_default_style( $filename = false, $return = 'content' ) {
380
  if ( ! $filename ) {
381
+ $mc_css_file = get_option( 'mc_css_file', '' );
382
  } else {
383
+ $mc_css_file = trim( $filename );
384
  }
385
  $mc_current_file = dirname( __FILE__ ) . '/templates/' . $mc_css_file;
386
+ if ( $mc_css_file && file_exists( $mc_current_file ) ) {
387
  $f = fopen( $mc_current_file, 'r' );
388
  $file = fread( $f, filesize( $mc_current_file ) );
389
  $mc_current_style = $file;
my-calendar-templates.php CHANGED
@@ -313,10 +313,10 @@ function mc_create_tags( $event, $context = 'filters' ) {
313
  $e['date_utc'] = date_i18n( apply_filters( 'mc_date_format', $date_format, 'template_begin_ts' ), $event->ts_occur_begin );
314
  $e['date_end_utc'] = date_i18n( apply_filters( 'mc_date_format', $date_format, 'template_end_ts' ), $event->ts_occur_end );
315
  $notime = esc_html( mc_notime_label( $event ) );
316
- $e['time'] = ( '00:00:00' === mc_date( 'H:i:s', strtotime( $real_begin_date ), false ) ) ? $notime : mc_date( get_option( 'mc_time_format' ), strtotime( $real_begin_date ), false );
317
- $e['time24'] = ( '00:00' === mc_date( 'G:i', strtotime( $real_begin_date ), false ) ) ? $notime : mc_date( get_option( 'mc_time_format' ), strtotime( $real_begin_date ), false );
318
  $endtime = ( '23:59:59' === $event->event_end ) ? '00:00:00' : mc_date( 'H:i:s', strtotime( $real_end_date ), false );
319
- $e['endtime'] = ( $real_end_date === $real_begin_date || '1' === $event->event_hide_end || '23:59:59' === mc_date( 'H:i:s', strtotime( $real_end_date ), false ) ) ? '' : date_i18n( get_option( 'mc_time_format' ), strtotime( $endtime ) );
320
  $e['runtime'] = mc_runtime( $event->ts_occur_begin, $event->ts_occur_end, $event );
321
  $e['duration'] = mc_duration( $event );
322
  $e['dtstart'] = mc_date( 'Y-m-d\TH:i:s', strtotime( $real_begin_date ), false ); // Date: hcal formatted.
@@ -965,8 +965,8 @@ function mc_format_date_span( $dates, $display = 'simple', $default = '' ) {
965
  $end = $date->occur_end;
966
  $day_begin = mc_date( 'Y-m-d', strtotime( $begin ), false );
967
  $day_end = mc_date( 'Y-m-d', strtotime( $end ), false );
968
- $bformat = '<span class="multidate-date">' . date_i18n( mc_date_format(), strtotime( $begin ) ) . "</span> <span class='multidate-time'>" . date_i18n( get_option( 'mc_time_format' ), strtotime( $begin ) ) . '</span>';
969
- $endtimeformat = ( '00:00:00' === $date->occur_end ) ? '' : ' ' . get_option( 'mc_time_format' );
970
  $eformat = ( $day_begin !== $day_end ) ? mc_date_format() . $endtimeformat : $endtimeformat;
971
  $span = ( '' !== $eformat ) ? " <span>&ndash;</span> <span class='multidate-end'>" : '';
972
  $endspan = ( '' !== $eformat ) ? '</span>' : '';
313
  $e['date_utc'] = date_i18n( apply_filters( 'mc_date_format', $date_format, 'template_begin_ts' ), $event->ts_occur_begin );
314
  $e['date_end_utc'] = date_i18n( apply_filters( 'mc_date_format', $date_format, 'template_end_ts' ), $event->ts_occur_end );
315
  $notime = esc_html( mc_notime_label( $event ) );
316
+ $e['time'] = ( '00:00:00' === mc_date( 'H:i:s', strtotime( $real_begin_date ), false ) ) ? $notime : mc_date( mc_time_format(), strtotime( $real_begin_date ), false );
317
+ $e['time24'] = ( '00:00' === mc_date( 'G:i', strtotime( $real_begin_date ), false ) ) ? $notime : mc_date( mc_time_format(), strtotime( $real_begin_date ), false );
318
  $endtime = ( '23:59:59' === $event->event_end ) ? '00:00:00' : mc_date( 'H:i:s', strtotime( $real_end_date ), false );
319
+ $e['endtime'] = ( $real_end_date === $real_begin_date || '1' === $event->event_hide_end || '23:59:59' === mc_date( 'H:i:s', strtotime( $real_end_date ), false ) ) ? '' : date_i18n( mc_time_format(), strtotime( $endtime ) );
320
  $e['runtime'] = mc_runtime( $event->ts_occur_begin, $event->ts_occur_end, $event );
321
  $e['duration'] = mc_duration( $event );
322
  $e['dtstart'] = mc_date( 'Y-m-d\TH:i:s', strtotime( $real_begin_date ), false ); // Date: hcal formatted.
965
  $end = $date->occur_end;
966
  $day_begin = mc_date( 'Y-m-d', strtotime( $begin ), false );
967
  $day_end = mc_date( 'Y-m-d', strtotime( $end ), false );
968
+ $bformat = '<span class="multidate-date">' . date_i18n( mc_date_format(), strtotime( $begin ) ) . "</span> <span class='multidate-time'>" . date_i18n( mc_time_format(), strtotime( $begin ) ) . '</span>';
969
+ $endtimeformat = ( '00:00:00' === $date->occur_end ) ? '' : ' ' . mc_time_format();
970
  $eformat = ( $day_begin !== $day_end ) ? mc_date_format() . $endtimeformat : $endtimeformat;
971
  $span = ( '' !== $eformat ) ? " <span>&ndash;</span> <span class='multidate-end'>" : '';
972
  $endspan = ( '' !== $eformat ) ? '</span>' : '';
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.9
21
  */
22
 
23
  /*
@@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
42
  }
43
 
44
  global $mc_version, $wpdb;
45
- $mc_version = '3.3.9';
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.3.10
21
  */
22
 
23
  /*
42
  }
43
 
44
  global $mc_version, $wpdb;
45
+ $mc_version = '3.3.10';
46
 
47
  define( 'MC_DEBUG', false );
48
 
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.9
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,16 @@ Translating my plugins is always appreciated. Visit <a href="https://translate.w
84
 
85
  == Changelog ==
86
 
 
 
 
 
 
 
 
 
 
 
87
  = 3.3.9 =
88
 
89
  * Feature: Ability to merge duplicate locations.
@@ -467,6 +477,4 @@ The search feature in My Calendar is pretty basic; but [buying My Calendar Pro](
467
  7. Style editing
468
  8. Template editing
469
 
470
- == Upgrade Notice ==
471
-
472
- * 3.3.0 Major release:
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
 
85
  == Changelog ==
86
 
87
+ = 3.3.10 =
88
+
89
+ * Bug fix: aria-current not rendered on event manager filters.
90
+ * Bug fix: published filter not marked as current by default.
91
+ * Bug fix: Cache allowed sites for CORS headers on multisite networks.
92
+ * Bug fix: fread error if no stylesheet defined.
93
+ * Bug fix: Extra closing div in single-day view.
94
+ * Bug fix: Better support for local user time.
95
+ * Change: Wrapper function for My Calendar time format: `mc_time_format()`
96
+
97
  = 3.3.9 =
98
 
99
  * Feature: Ability to merge duplicate locations.
477
  7. Style editing
478
  8. Template editing
479
 
480
+ == Upgrade Notice ==