My Calendar - Version 3.2.11

Version Description

  • Bug fix: switching to week view display broken.
  • Bug fix: links to template help pointed to old location for help.
  • Bug fix: AJAX nav pulled height from first rendered calendar, not current navigating calendar.
  • Change: filter to pass custom notices for front end submissions and editing.
  • Remove fallback function for is_ssl()
  • Improve conflicting event errors when the conflicting event is still unpublished.
  • Add custom template to pass a calendar that's embeddable via iframe.
  • Bug fix: Multisite environments need to use navigation on current site, not from remote site.
Download this release

Release Info

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

Code changes from version 3.2.10 to 3.2.11

includes/date-utilities.php CHANGED
@@ -200,7 +200,7 @@ function mc_date_diff_precise( $start, $end = 'NOW' ) {
200
  *
201
  * @return integer $week_of_event The week of the month this date falls in;
202
  */
203
- function week_of_month( $date_of_event ) {
204
  $week_of_event = 0;
205
  switch ( $date_of_event ) {
206
  case ( $date_of_event >= 1 && $date_of_event < 8 ):
200
  *
201
  * @return integer $week_of_event The week of the month this date falls in;
202
  */
203
+ function mc_week_of_month( $date_of_event ) {
204
  $week_of_event = 0;
205
  switch ( $date_of_event ) {
206
  case ( $date_of_event >= 1 && $date_of_event < 8 ):
includes/deprecated.php CHANGED
@@ -88,28 +88,6 @@ function mc_event_repeats_forever( $recur, $repeats ) {
88
  }
89
  }
90
 
91
- if ( ! function_exists( 'is_ssl' ) ) {
92
- /**
93
- * Try to check whether site is running in an HTTPS environment.
94
- *
95
- * Currently used only in My Calendar PRO; exists in both for back compat
96
- */
97
- function is_ssl() {
98
- if ( isset( $_SERVER['HTTPS'] ) ) {
99
- if ( 'on' === strtolower( $_SERVER['HTTPS'] ) ) {
100
- return true;
101
- }
102
- if ( '1' === $_SERVER['HTTPS'] ) {
103
- return true;
104
- }
105
- } elseif ( isset( $_SERVER['SERVER_PORT'] ) && ( '443' === (string) $_SERVER['SERVER_PORT'] ) ) {
106
- return true;
107
- }
108
-
109
- return false;
110
- }
111
- }
112
-
113
  /**
114
  * Old name of template drawing function. Deprecated 6/14/2018. Removed in Pro 3/31/2019.
115
  *
88
  }
89
  }
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  /**
92
  * Old name of template drawing function. Deprecated 6/14/2018. Removed in Pro 3/31/2019.
93
  *
js/mc-ajax.js CHANGED
@@ -7,7 +7,7 @@
7
  var calendar = $( this ).closest( '.mc-main' );
8
  var ref = calendar.attr('id');
9
  var link = $(this).attr('href');
10
- var height = $('.mc-main' ).height();
11
  $('#' + ref).html('<div class=\"mc-loading\"></div><div class=\"loading\" style=\"height:' + height + 'px\"><span class="screen-reader-text">Loading...</span></div>');
12
  $('#' + ref).load(link + ' #' + ref + ' > *', function ( response, status, xhr ) {
13
 
7
  var calendar = $( this ).closest( '.mc-main' );
8
  var ref = calendar.attr('id');
9
  var link = $(this).attr('href');
10
+ var height = calendar.height();
11
  $('#' + ref).html('<div class=\"mc-loading\"></div><div class=\"loading\" style=\"height:' + height + 'px\"><span class="screen-reader-text">Loading...</span></div>');
12
  $('#' + ref).load(link + ' #' + ref + ' > *', function ( response, status, xhr ) {
13
 
my-calendar-call-template.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Load template for Twitter player cards
4
+ *
5
+ * @category Core
6
+ * @package WP Tweets Pro
7
+ * @author Joe Dolson
8
+ * @license GPLv2 or later
9
+ * @link https://www.joedolson.com/wp-tweets-pro/
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+
16
+ define( 'MC_TEMPLATES', trailingslashit( dirname( __FILE__ ) ) . 'templates/' );
17
+ add_action( 'template_redirect', 'mc_embed_template' );
18
+ /**
19
+ * Load Template.
20
+ *
21
+ * This template must be named "my-calendar-template.php".
22
+ *
23
+ * First, this function will look in the child theme
24
+ * then in the parent theme and if no template is found
25
+ * in either theme, the default template will be loaded
26
+ * from the plugin's folder.
27
+ *
28
+ * This function is hooked into the "template_redirect"
29
+ * action and terminates script execution.
30
+ *
31
+ * @return void
32
+ * @since 2020-12-14
33
+ */
34
+ function mc_embed_template() {
35
+ // Return early if there is no reason to proceed.
36
+ if ( ! isset( $_GET['embed'] ) ) {
37
+ return;
38
+ }
39
+
40
+ // Check to see if there is a template in the theme.
41
+ $template = locate_template( array( 'my-calendar-template.php' ) );
42
+ if ( ! empty( $template ) ) {
43
+ require_once( $template );
44
+ exit;
45
+ } else {
46
+ // Use plugin's template file.
47
+ require_once( MC_TEMPLATES . 'my-calendar-template.php' );
48
+ exit;
49
+ }
50
+
51
+ // You've gone too far. Error case.
52
+ header( 'HTTP/1.0 404 Not Found' );
53
+ exit;
54
+ }
my-calendar-core.php CHANGED
@@ -2072,3 +2072,23 @@ function my_calendar_privacy_eraser( $email_address, $page = 1 ) {
2072
  'done' => true,
2073
  );
2074
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2072
  'done' => true,
2073
  );
2074
  }
2075
+
2076
+ /**
2077
+ * Allow CORS from subsites in multisite networks in subdomain setups.
2078
+ */
2079
+ function mc_setup_cors_access() {
2080
+ $origin = str_replace( array( 'http://', 'https://' ), '', get_http_origin() );
2081
+ $sites = ( function_exists( 'get_sites' ) ) ? get_sites() : array();
2082
+ $allowed = apply_filters( 'mc_setup_allowed_sites', array(), $origin );
2083
+ if ( ! empty( $sites ) ) {
2084
+ foreach ( $sites as $site ) {
2085
+ $allowed[] = str_replace( array( 'http://', 'https://' ), '', get_home_url( $site->blog_id ) );
2086
+ }
2087
+ }
2088
+ if ( $origin && is_array( $allowed ) && in_array( $origin, $allowed, true ) ) {
2089
+ header( 'Access-Control-Allow-Origin: ' . esc_url_raw( $origin ) );
2090
+ header( 'Access-Control-Allow-Methods: GET' );
2091
+ header( 'Access-Control-Allow-Credentials: true' );
2092
+ }
2093
+ }
2094
+ add_action( 'send_headers', 'mc_setup_cors_access' );
my-calendar-event-manager.php CHANGED
@@ -415,16 +415,17 @@ function mc_show_error( $message, $echo = true ) {
415
  /**
416
  * Display an update message.
417
  *
418
- * @param string $message Update message.
419
- * @param boolean $echo Echo or return. Default true (echo).
 
420
  *
421
  * @return string
422
  */
423
- function mc_show_notice( $message, $echo = true ) {
424
  if ( trim( $message ) === '' ) {
425
  return '';
426
  }
427
- $message = strip_tags( $message, mc_admin_strip_tags() );
428
  $message = "<div class='updated'><p>$message</p></div>";
429
  if ( $echo ) {
430
  echo $message;
@@ -694,7 +695,7 @@ function my_calendar_save( $action, $output, $event_id = false ) {
694
  my_calendar_send_email( $event );
695
  }
696
  if ( '0' === (string) $add['event_approved'] ) {
697
- $message = mc_show_notice( __( 'Event draft saved.', 'my-calendar' ), false );
698
  } else {
699
  // jd_doTwitterAPIPost was changed to wpt_post_to_twitter on 1.19.2017.
700
  if ( function_exists( 'wpt_post_to_twitter' ) && isset( $_POST['mc_twitter'] ) && '' !== trim( $_POST['mc_twitter'] ) ) {
@@ -715,7 +716,7 @@ function my_calendar_save( $action, $output, $event_id = false ) {
715
  // Translators: URL to view event in calendar.
716
  $message .= sprintf( __( ' <a href="%s">View Event</a>', 'my-calendar' ), $event_link );
717
  }
718
- $message = mc_show_notice( $message, false );
719
  }
720
  }
721
  }
@@ -768,7 +769,7 @@ function my_calendar_save( $action, $output, $event_id = false ) {
768
  } else {
769
  // Only dates were changed.
770
  $result = mc_update_instance( $event_instance, $event_id, $update );
771
- $message = mc_show_notice( __( 'Date/time information for this event has been updated.', 'my-calendar' ) . " $url", false );
772
  }
773
  }
774
  } else {
@@ -812,7 +813,7 @@ function my_calendar_save( $action, $output, $event_id = false ) {
812
  // Don't execute transition actions if prev status not known.
813
  do_action( 'mc_transition_event', (int) $_POST['prev_event_status'], $event_approved, $action, $data, $event_id );
814
  }
815
- $message = mc_show_notice( __( 'Event updated successfully', 'my-calendar' ) . ". $url", false );
816
  }
817
  } else {
818
  $message = mc_show_error( __( 'You do not have sufficient permissions to edit that event.', 'my-calendar' ), false );
@@ -936,7 +937,7 @@ function mc_delete_event( $event_id ) {
936
  } else {
937
  do_action( 'mc_delete_event', $event_id, $post_id );
938
  }
939
- $message = mc_show_notice( __( 'Event deleted successfully', 'my-calendar' ), false );
940
  } else {
941
  $message = mc_show_error( __( 'Despite issuing a request to delete, the event still remains in the database. Please investigate.', 'my-calendar' ), false );
942
  }
@@ -2790,9 +2791,21 @@ function mc_check_data( $action, $post, $i ) {
2790
  if ( $conflicts ) {
2791
  $conflict_id = $conflicts[0]->occur_id;
2792
  $conflict_ev = mc_get_event( $conflict_id );
2793
- $conflict = mc_get_details_link( $conflict_ev );
2794
- // Translators: URL to event details.
2795
- $errors .= mc_show_error( sprintf( __( 'That event conflicts with a <a href="%s">previously scheduled event</a>.', 'my-calendar' ), $conflict ), false );
 
 
 
 
 
 
 
 
 
 
 
 
2796
  }
2797
  }
2798
  $spam_content = ( '' !== $desc ) ? $desc : $short;
@@ -2942,9 +2955,7 @@ function mcs_check_conflicts( $begin, $time, $end, $endtime, $event_label ) {
2942
  $results = $wpdb->get_results( $wpdb->prepare( $event_query, $begin_time, $end_time, $begin_time, $end_time ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
2943
 
2944
  if ( empty( $results ) ) {
2945
- // Alternate: where "begin time" between occur_begin & occur_end OR "end time" between occur_begin & occur_end.
2946
- // Finds events that conflict because they either start or end during the event.
2947
- // This query might actually find *all* conflicts; check this. JCD TODO.
2948
  $event_query2 = 'SELECT occur_id
2949
  FROM ' . my_calendar_event_table() . '
2950
  JOIN ' . my_calendar_table() . "
@@ -3973,7 +3984,7 @@ function mc_increment_event( $id, $post = array(), $test = false, $instances = a
3973
  break;
3974
  case 'U':
3975
  // Important to keep track of which date variables are strings and which are timestamps.
3976
- $week_of_event = week_of_month( mc_date( 'd', strtotime( $event->event_begin ), false ) );
3977
  $newbegin = my_calendar_add_date( $orig_begin, 28, 0, 0 );
3978
  $newend = my_calendar_add_date( $orig_end, 28, 0, 0 );
3979
  $fifth_week = $event->event_fifth_week;
@@ -3995,13 +4006,13 @@ function mc_increment_event( $id, $post = array(), $test = false, $instances = a
3995
  $numforward = ( $numforward - 1 );
3996
  for ( $i = 0; $i <= $numforward; $i ++ ) {
3997
  $next_week_diff = ( mc_date( 'm', $newbegin, false ) === mc_date( 'm', my_calendar_add_date( mc_date( 'Y-m-d', $newbegin, false ), 7, 0, 0 ) ) ) ? false : true;
3998
- $move_event = ( ( 1 === (int) $fifth_week ) && ( ( week_of_month( mc_date( 'd', $newbegin ), false ) + 1 ) === (int) $week_of_event ) && true === $next_week_diff ) ? true : false;
3999
- if ( week_of_month( mc_date( 'd', $newbegin, false ) ) === $week_of_event || true === $move_event ) {
4000
  } else {
4001
  $newbegin = my_calendar_add_date( mc_date( 'Y-m-d H:i:s', $newbegin, false ), 7, 0, 0 );
4002
  $newend = my_calendar_add_date( mc_date( 'Y-m-d H:i:s', $newend, false ), 7, 0, 0 );
4003
- $move_event = ( 1 === (int) $fifth_week && week_of_month( mc_date( 'd', $newbegin ), false ) + 1 === (int) $week_of_event ) ? true : false;
4004
- if ( week_of_month( mc_date( 'd', $newbegin, false ) ) === $week_of_event || true === $move_event ) {
4005
  } else {
4006
  $newbegin = my_calendar_add_date( mc_date( 'Y-m-d H:i:s', $newbegin, false ), 14, 0, 0 );
4007
  $newend = my_calendar_add_date( mc_date( 'Y-m-d H:i:s', $newend, false ), 14, 0, 0 );
415
  /**
416
  * Display an update message.
417
  *
418
+ * @param string $message Update message.
419
+ * @param boolean $echo Echo or return. Default true (echo).
420
+ * @param boolean|string $code Message code.
421
  *
422
  * @return string
423
  */
424
+ function mc_show_notice( $message, $echo = true, $code = false ) {
425
  if ( trim( $message ) === '' ) {
426
  return '';
427
  }
428
+ $message = strip_tags( apply_filters( 'mc_filter_notice', $message, $code ), mc_admin_strip_tags() );
429
  $message = "<div class='updated'><p>$message</p></div>";
430
  if ( $echo ) {
431
  echo $message;
695
  my_calendar_send_email( $event );
696
  }
697
  if ( '0' === (string) $add['event_approved'] ) {
698
+ $message = mc_show_notice( __( 'Event draft saved.', 'my-calendar' ), false, 'draft-saved' );
699
  } else {
700
  // jd_doTwitterAPIPost was changed to wpt_post_to_twitter on 1.19.2017.
701
  if ( function_exists( 'wpt_post_to_twitter' ) && isset( $_POST['mc_twitter'] ) && '' !== trim( $_POST['mc_twitter'] ) ) {
716
  // Translators: URL to view event in calendar.
717
  $message .= sprintf( __( ' <a href="%s">View Event</a>', 'my-calendar' ), $event_link );
718
  }
719
+ $message = mc_show_notice( $message, false, 'new-event' );
720
  }
721
  }
722
  }
769
  } else {
770
  // Only dates were changed.
771
  $result = mc_update_instance( $event_instance, $event_id, $update );
772
+ $message = mc_show_notice( __( 'Date/time information for this event has been updated.', 'my-calendar' ) . " $url", false, 'date-updated' );
773
  }
774
  }
775
  } else {
813
  // Don't execute transition actions if prev status not known.
814
  do_action( 'mc_transition_event', (int) $_POST['prev_event_status'], $event_approved, $action, $data, $event_id );
815
  }
816
+ $message = mc_show_notice( __( 'Event updated successfully', 'my-calendar' ) . ". $url", false, 'event-updated' );
817
  }
818
  } else {
819
  $message = mc_show_error( __( 'You do not have sufficient permissions to edit that event.', 'my-calendar' ), false );
937
  } else {
938
  do_action( 'mc_delete_event', $event_id, $post_id );
939
  }
940
+ $message = mc_show_notice( __( 'Event deleted successfully', 'my-calendar' ), false, 'event-deleted' );
941
  } else {
942
  $message = mc_show_error( __( 'Despite issuing a request to delete, the event still remains in the database. Please investigate.', 'my-calendar' ), false );
943
  }
2791
  if ( $conflicts ) {
2792
  $conflict_id = $conflicts[0]->occur_id;
2793
  $conflict_ev = mc_get_event( $conflict_id );
2794
+ if ( '1' === $conflict_ev->event_approved ) {
2795
+ $conflict = mc_get_details_link( $conflict_ev );
2796
+ // Translators: URL to event details.
2797
+ $errors .= mc_show_error( sprintf( __( 'That event conflicts with a <a href="%s">previously scheduled event</a>.', 'my-calendar' ), $conflict ), false, 'conflict' );
2798
+ } else {
2799
+ if ( mc_can_edit_event( $conflict_ev->event_id ) ) {
2800
+ $referer = urlencode( mc_get_current_url() );
2801
+ $link = admin_url( "admin.php?page=my-calendar&amp;mode=edit&amp;event_id=$event->event_id&amp;ref=$referer" );
2802
+ // Translators: Link to edit event draft.
2803
+ $error = sprintf( __( 'That event conflicts with a <a href="%s">previously submitted draft</a>.', 'my-calendar' ), $link );
2804
+ } else {
2805
+ $error = __( 'That event conflicts with an unpublished draft event.', 'my-calendar' );
2806
+ }
2807
+ $errors .= mc_show_error( $error, false, 'draft-conflict' );
2808
+ }
2809
  }
2810
  }
2811
  $spam_content = ( '' !== $desc ) ? $desc : $short;
2955
  $results = $wpdb->get_results( $wpdb->prepare( $event_query, $begin_time, $end_time, $begin_time, $end_time ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
2956
 
2957
  if ( empty( $results ) ) {
2958
+ // Finds events that conflict if they either start or end during another event.
 
 
2959
  $event_query2 = 'SELECT occur_id
2960
  FROM ' . my_calendar_event_table() . '
2961
  JOIN ' . my_calendar_table() . "
3984
  break;
3985
  case 'U':
3986
  // Important to keep track of which date variables are strings and which are timestamps.
3987
+ $week_of_event = mc_week_of_month( mc_date( 'd', strtotime( $event->event_begin ), false ) );
3988
  $newbegin = my_calendar_add_date( $orig_begin, 28, 0, 0 );
3989
  $newend = my_calendar_add_date( $orig_end, 28, 0, 0 );
3990
  $fifth_week = $event->event_fifth_week;
4006
  $numforward = ( $numforward - 1 );
4007
  for ( $i = 0; $i <= $numforward; $i ++ ) {
4008
  $next_week_diff = ( mc_date( 'm', $newbegin, false ) === mc_date( 'm', my_calendar_add_date( mc_date( 'Y-m-d', $newbegin, false ), 7, 0, 0 ) ) ) ? false : true;
4009
+ $move_event = ( ( 1 === (int) $fifth_week ) && ( ( mc_week_of_month( mc_date( 'd', $newbegin ), false ) + 1 ) === (int) $week_of_event ) && true === $next_week_diff ) ? true : false;
4010
+ if ( mc_week_of_month( mc_date( 'd', $newbegin, false ) ) === $week_of_event || true === $move_event ) {
4011
  } else {
4012
  $newbegin = my_calendar_add_date( mc_date( 'Y-m-d H:i:s', $newbegin, false ), 7, 0, 0 );
4013
  $newend = my_calendar_add_date( mc_date( 'Y-m-d H:i:s', $newend, false ), 7, 0, 0 );
4014
+ $move_event = ( 1 === (int) $fifth_week && mc_week_of_month( mc_date( 'd', $newbegin ), false ) + 1 === (int) $week_of_event ) ? true : false;
4015
+ if ( mc_week_of_month( mc_date( 'd', $newbegin, false ) ) === $week_of_event || true === $move_event ) {
4016
  } else {
4017
  $newbegin = my_calendar_add_date( mc_date( 'Y-m-d H:i:s', $newbegin, false ), 14, 0, 0 );
4018
  $newend = my_calendar_add_date( mc_date( 'Y-m-d H:i:s', $newend, false ), 14, 0, 0 );
my-calendar-output.php CHANGED
@@ -828,6 +828,21 @@ function mc_date_switcher( $type = 'calendar', $cid = 'all', $time = 'month', $d
828
  return $date_switcher;
829
  }
830
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
831
  /**
832
  * Generate toggle between list and grid views
833
  *
@@ -843,10 +858,12 @@ function mc_format_toggle( $format, $toggle, $time ) {
843
  switch ( $format ) {
844
  case 'list':
845
  $url = mc_build_url( array( 'format' => 'calendar' ), array() );
 
846
  $toggle .= "<a href='$url' class='grid mcajax'>" . __( '<span class="maybe-hide">View as </span>Grid', 'my-calendar' ) . '</a>';
847
  break;
848
  default:
849
  $url = mc_build_url( array( 'format' => 'list' ), array() );
 
850
  $toggle .= "<a href='$url' class='list mcajax'>" . __( '<span class="maybe-hide">View as </span>List', 'my-calendar' ) . '</a>';
851
  break;
852
  }
@@ -882,11 +899,13 @@ function mc_format_toggle( $format, $toggle, $time ) {
882
  function mc_time_toggle( $format, $time, $month, $year, $current, $start_of_week, $from ) {
883
  // if dy parameter not set, use today's date instead of first day of month.
884
  $weeks_day = mc_first_day_of_week( $current );
 
885
  if ( isset( $_GET['dy'] ) ) {
886
  if ( '' === $_GET['dy'] ) {
887
  $current_day = $weeks_day[0];
888
  if ( -1 === (int) $weeks_day[1] ) {
889
- $month = $month - 1;
 
890
  }
891
  } else {
892
  $current_day = absint( $_GET['dy'] );
@@ -913,7 +932,7 @@ function mc_time_toggle( $format, $time, $month, $year, $current, $start_of_week
913
  if ( 'mini' !== $format ) {
914
  $toggle = "<div class='mc-time'>";
915
  $current_url = mc_get_current_url();
916
- if ( -1 === (int) $adjust ) {
917
  $wmonth = ( 1 !== (int) $month ) ? $month - 1 : 12;
918
  } else {
919
  $wmonth = $month;
@@ -921,6 +940,7 @@ function mc_time_toggle( $format, $time, $month, $year, $current, $start_of_week
921
  switch ( $time ) {
922
  case 'week':
923
  $url = mc_build_url( array( 'time' => 'month' ), array( 'mc_id' ) );
 
924
  $toggle .= "<a href='$url' class='month mcajax'>" . __( 'Month', 'my-calendar' ) . '</a>';
925
  $toggle .= "<span class='mc-active week'>" . __( 'Week', 'my-calendar' ) . '</span>';
926
  $url = mc_build_url(
@@ -930,10 +950,12 @@ function mc_time_toggle( $format, $time, $month, $year, $current, $start_of_week
930
  ),
931
  array( 'dy', 'mc_id' )
932
  );
 
933
  $toggle .= "<a href='$url' class='day mcajax'>" . __( 'Day', 'my-calendar' ) . '</a>';
934
  break;
935
  case 'day':
936
  $url = mc_build_url( array( 'time' => 'month' ), array() );
 
937
  $toggle .= "<a href='$url' class='month mcajax'>" . __( 'Month', 'my-calendar' ) . '</a>';
938
  $url = mc_build_url(
939
  array(
@@ -944,6 +966,7 @@ function mc_time_toggle( $format, $time, $month, $year, $current, $start_of_week
944
  ),
945
  array( 'dy', 'month', 'mc_id' )
946
  );
 
947
  $toggle .= "<a href='$url' class='week mcajax'>" . __( 'Week', 'my-calendar' ) . '</a>';
948
  $toggle .= "<span class='mc-active day'>" . __( 'Day', 'my-calendar' ) . '</span>';
949
  break;
@@ -957,8 +980,10 @@ function mc_time_toggle( $format, $time, $month, $year, $current, $start_of_week
957
  ),
958
  array( 'dy', 'month', 'mc_id' )
959
  );
 
960
  $toggle .= "<a href='$url' class='week mcajax'>" . __( 'Week', 'my-calendar' ) . '</a>';
961
  $url = mc_build_url( array( 'time' => 'day' ), array() );
 
962
  $toggle .= "<a href='$url' class='day mcajax'>" . __( 'Day', 'my-calendar' ) . '</a>';
963
  break;
964
  }
@@ -1407,10 +1432,10 @@ function mc_show_event_template( $content ) {
1407
  if ( 'mc-events' === $post->post_type ) {
1408
  $event_id = get_post_meta( $post->ID, '_mc_event_id', true );
1409
  if ( isset( $_GET['mc_id'] ) && mc_valid_id( $_GET['mc_id'] ) ) {
1410
- $mc_id = intval( $_GET['mc_id'] );
1411
- $event = mc_get_event( $mc_id, 'object' );
1412
- $date = mc_date( 'Y-m-d', strtotime( $event->occur_begin ), false );
1413
- $time = mc_date( 'H:i:00', strtotime( $event->occur_begin ), false );
1414
  } else {
1415
  if ( is_numeric( $event_id ) ) {
1416
  $event = mc_get_nearest_event( $event_id );
@@ -2032,6 +2057,11 @@ function mc_get_from_to( $show_months, $params, $date ) {
2032
  * @return array of calendar nav for top & bottom
2033
  */
2034
  function mc_generate_calendar_nav( $params, $cat, $start_of_week, $show_months, $main_class, $site, $date, $from ) {
 
 
 
 
 
2035
  $format = $params['format'];
2036
  $category = $params['category'];
2037
  $above = $params['above'];
@@ -2189,6 +2219,10 @@ function mc_generate_calendar_nav( $params, $cat, $start_of_week, $show_months,
2189
  $mc_bottomnav = "<div class='mc_bottomnav my-calendar-footer'>$mc_bottomnav</div>";
2190
  }
2191
 
 
 
 
 
2192
  return array(
2193
  'bottom' => $mc_bottomnav,
2194
  'top' => $mc_topnav,
@@ -2309,6 +2343,7 @@ function mc_nav( $date, $format, $time, $show_months, $class ) {
2309
  ),
2310
  array()
2311
  );
 
2312
  $next_link = mc_build_url(
2313
  array(
2314
  'yr' => $next['yr'],
@@ -2318,6 +2353,7 @@ function mc_nav( $date, $format, $time, $show_months, $class ) {
2318
  ),
2319
  array()
2320
  );
 
2321
 
2322
  $prev_link = apply_filters( 'mc_previous_link', '<li class="my-calendar-prev"><a href="' . $prev_link . '" rel="nofollow" class="mcajax">' . $prev['label'] . '</a></li>', $prev );
2323
  $next_link = apply_filters( 'mc_next_link', '<li class="my-calendar-next"><a href="' . $next_link . '" rel="nofollow" class="mcajax">' . $next['label'] . '</a></li>', $next );
@@ -2509,6 +2545,7 @@ function mc_category_key( $category ) {
2509
  } else {
2510
  $url = mc_build_url( array( 'mcat' => $selectable_categories ), array( 'mcat' ) );
2511
  }
 
2512
  if ( 1 === (int) $cat->category_private ) {
2513
  $class .= ' private';
2514
  }
@@ -2526,7 +2563,7 @@ function mc_category_key( $category ) {
2526
  $key .= '<li class="cat_' . $class . '"><a href="' . esc_url( $url ) . '" class="mcajax"' . $aria_current . '>' . $cat_key . '</a></li>';
2527
  }
2528
  if ( isset( $_GET['mcat'] ) ) {
2529
- $key .= "<li class='all-categories'><a href='" . esc_url( mc_build_url( array(), array( 'mcat' ), mc_get_current_url() ) ) . "' class='mcajax'>" . apply_filters( 'mc_text_all_categories', __( 'All Categories', 'my-calendar' ) ) . '</a></li>';
2530
  }
2531
  $key .= '</ul></div>';
2532
  $key = apply_filters( 'mc_category_key', $key, $categories );
828
  return $date_switcher;
829
  }
830
 
831
+ /**
832
+ * Is this URL being queried while in the primary content.
833
+ *
834
+ * @param string $url URL to attach query to.
835
+ *
836
+ * @return string
837
+ */
838
+ function mc_url_in_loop( $url ) {
839
+ if ( is_singular() && in_the_loop() && is_main_query() ) {
840
+ $url = add_query_arg( 'embed', 'true' );
841
+ }
842
+
843
+ return $url;
844
+ }
845
+
846
  /**
847
  * Generate toggle between list and grid views
848
  *
858
  switch ( $format ) {
859
  case 'list':
860
  $url = mc_build_url( array( 'format' => 'calendar' ), array() );
861
+ $url = mc_url_in_loop( $url );
862
  $toggle .= "<a href='$url' class='grid mcajax'>" . __( '<span class="maybe-hide">View as </span>Grid', 'my-calendar' ) . '</a>';
863
  break;
864
  default:
865
  $url = mc_build_url( array( 'format' => 'list' ), array() );
866
+ $url = mc_url_in_loop( $url );
867
  $toggle .= "<a href='$url' class='list mcajax'>" . __( '<span class="maybe-hide">View as </span>List', 'my-calendar' ) . '</a>';
868
  break;
869
  }
899
  function mc_time_toggle( $format, $time, $month, $year, $current, $start_of_week, $from ) {
900
  // if dy parameter not set, use today's date instead of first day of month.
901
  $weeks_day = mc_first_day_of_week( $current );
902
+ $adjusted = false;
903
  if ( isset( $_GET['dy'] ) ) {
904
  if ( '' === $_GET['dy'] ) {
905
  $current_day = $weeks_day[0];
906
  if ( -1 === (int) $weeks_day[1] ) {
907
+ $adjusted = true;
908
+ $month = $month - 1;
909
  }
910
  } else {
911
  $current_day = absint( $_GET['dy'] );
932
  if ( 'mini' !== $format ) {
933
  $toggle = "<div class='mc-time'>";
934
  $current_url = mc_get_current_url();
935
+ if ( -1 === (int) $adjust && ! $adjusted ) {
936
  $wmonth = ( 1 !== (int) $month ) ? $month - 1 : 12;
937
  } else {
938
  $wmonth = $month;
940
  switch ( $time ) {
941
  case 'week':
942
  $url = mc_build_url( array( 'time' => 'month' ), array( 'mc_id' ) );
943
+ $url = mc_url_in_loop( $url );
944
  $toggle .= "<a href='$url' class='month mcajax'>" . __( 'Month', 'my-calendar' ) . '</a>';
945
  $toggle .= "<span class='mc-active week'>" . __( 'Week', 'my-calendar' ) . '</span>';
946
  $url = mc_build_url(
950
  ),
951
  array( 'dy', 'mc_id' )
952
  );
953
+ $url = mc_url_in_loop( $url );
954
  $toggle .= "<a href='$url' class='day mcajax'>" . __( 'Day', 'my-calendar' ) . '</a>';
955
  break;
956
  case 'day':
957
  $url = mc_build_url( array( 'time' => 'month' ), array() );
958
+ $url = mc_url_in_loop( $url );
959
  $toggle .= "<a href='$url' class='month mcajax'>" . __( 'Month', 'my-calendar' ) . '</a>';
960
  $url = mc_build_url(
961
  array(
966
  ),
967
  array( 'dy', 'month', 'mc_id' )
968
  );
969
+ $url = mc_url_in_loop( $url );
970
  $toggle .= "<a href='$url' class='week mcajax'>" . __( 'Week', 'my-calendar' ) . '</a>';
971
  $toggle .= "<span class='mc-active day'>" . __( 'Day', 'my-calendar' ) . '</span>';
972
  break;
980
  ),
981
  array( 'dy', 'month', 'mc_id' )
982
  );
983
+ $url = mc_url_in_loop( $url );
984
  $toggle .= "<a href='$url' class='week mcajax'>" . __( 'Week', 'my-calendar' ) . '</a>';
985
  $url = mc_build_url( array( 'time' => 'day' ), array() );
986
+ $url = mc_url_in_loop( $url );
987
  $toggle .= "<a href='$url' class='day mcajax'>" . __( 'Day', 'my-calendar' ) . '</a>';
988
  break;
989
  }
1432
  if ( 'mc-events' === $post->post_type ) {
1433
  $event_id = get_post_meta( $post->ID, '_mc_event_id', true );
1434
  if ( isset( $_GET['mc_id'] ) && mc_valid_id( $_GET['mc_id'] ) ) {
1435
+ $mc_id = intval( $_GET['mc_id'] );
1436
+ $event = mc_get_event( $mc_id, 'object' );
1437
+ $date = mc_date( 'Y-m-d', strtotime( $event->occur_begin ), false );
1438
+ $time = mc_date( 'H:i:00', strtotime( $event->occur_begin ), false );
1439
  } else {
1440
  if ( is_numeric( $event_id ) ) {
1441
  $event = mc_get_nearest_event( $event_id );
2057
  * @return array of calendar nav for top & bottom
2058
  */
2059
  function mc_generate_calendar_nav( $params, $cat, $start_of_week, $show_months, $main_class, $site, $date, $from ) {
2060
+ if ( $site ) {
2061
+ $site = ( 'global' === $site ) ? BLOG_ID_CURRENT_SITE : $site;
2062
+ $restore = $site;
2063
+ restore_current_blog();
2064
+ }
2065
  $format = $params['format'];
2066
  $category = $params['category'];
2067
  $above = $params['above'];
2219
  $mc_bottomnav = "<div class='mc_bottomnav my-calendar-footer'>$mc_bottomnav</div>";
2220
  }
2221
 
2222
+ if ( $site ) {
2223
+ switch_to_blog( $restore );
2224
+ }
2225
+
2226
  return array(
2227
  'bottom' => $mc_bottomnav,
2228
  'top' => $mc_topnav,
2343
  ),
2344
  array()
2345
  );
2346
+ $prev_link = mc_url_in_loop( $prev_link );
2347
  $next_link = mc_build_url(
2348
  array(
2349
  'yr' => $next['yr'],
2353
  ),
2354
  array()
2355
  );
2356
+ $next_link = mc_url_in_loop( $next_link );
2357
 
2358
  $prev_link = apply_filters( 'mc_previous_link', '<li class="my-calendar-prev"><a href="' . $prev_link . '" rel="nofollow" class="mcajax">' . $prev['label'] . '</a></li>', $prev );
2359
  $next_link = apply_filters( 'mc_next_link', '<li class="my-calendar-next"><a href="' . $next_link . '" rel="nofollow" class="mcajax">' . $next['label'] . '</a></li>', $next );
2545
  } else {
2546
  $url = mc_build_url( array( 'mcat' => $selectable_categories ), array( 'mcat' ) );
2547
  }
2548
+ $url = mc_url_in_loop( $url );
2549
  if ( 1 === (int) $cat->category_private ) {
2550
  $class .= ' private';
2551
  }
2563
  $key .= '<li class="cat_' . $class . '"><a href="' . esc_url( $url ) . '" class="mcajax"' . $aria_current . '>' . $cat_key . '</a></li>';
2564
  }
2565
  if ( isset( $_GET['mcat'] ) ) {
2566
+ $key .= "<li class='all-categories'><a href='" . esc_url( mc_url_in_loop( mc_build_url( array(), array( 'mcat' ), mc_get_current_url() ) ) ) . "' class='mcajax'>" . apply_filters( 'mc_text_all_categories', __( 'All Categories', 'my-calendar' ) ) . '</a></li>';
2567
  }
2568
  $key .= '</ul></div>';
2569
  $key = apply_filters( 'mc_category_key', $key, $categories );
my-calendar-settings.php CHANGED
@@ -652,16 +652,16 @@ function mc_remote_db() {
652
  <fieldset>
653
  <legend class="screen-reader-text"><?php _e( 'Customize Text Fields', 'my-calendar' ); ?></legend>
654
  <ul>
655
- <li><?php mc_settings_field( 'mc_title_template', __( 'Event title (Grid)', 'my-calendar' ), $mc_title_template, "<a href='" . admin_url( 'admin.php?page=my-calendar-help#templates' ) . "'>" . __( 'Templating Help', 'my-calendar' ) . '</a>' ); ?></li>
656
- <li><?php mc_settings_field( 'mc_title_template_solo', __( 'Event title (Single)', 'my-calendar' ), $mc_title_template_solo, "<a href='" . admin_url( 'admin.php?page=my-calendar-help#templates' ) . "'>" . __( 'Templating Help', 'my-calendar' ) . '</a>' ); ?></li>
657
- <li><?php mc_settings_field( 'mc_title_template_list', __( 'Event title (List)', 'my-calendar' ), $mc_title_template_list, "<a href='" . admin_url( 'admin.php?page=my-calendar-help#templates' ) . "'>" . __( 'Templating Help', 'my-calendar' ) . '</a>' ); ?></li>
658
  <li><?php mc_settings_field( 'mc_notime_text', __( 'Label for all-day events', 'my-calendar' ), 'All Day' ); ?></li>
659
  <li><?php mc_settings_field( 'mc_previous_events', __( 'Previous events link', 'my-calendar' ), __( 'Previous', 'my-calendar' ), __( 'Use <code>{date}</code> to display date in navigation.', 'my-calendar' ) ); ?></li>
660
  <li><?php mc_settings_field( 'mc_next_events', __( 'Next events link', 'my-calendar' ), __( 'Next', 'my-calendar' ), __( 'Use <code>{date}</code> to display date in navigation.', 'my-calendar' ) ); ?></li>
661
  <li><?php mc_settings_field( 'mc_week_caption', __( 'Week view caption:', 'my-calendar' ), '', __( 'Available tag: <code>{date format=""}</code>', 'my-calendar' ) ); ?></li>
662
  <li><?php mc_settings_field( 'mc_caption', __( 'Extended caption:', 'my-calendar' ), '', __( 'Follows month/year in list views.', 'my-calendar' ) ); ?></li>
663
  <li><?php mc_settings_field( 'mc_details_label', __( 'Event details link text', 'my-calendar' ), $mc_details_label, __( 'Tags: <code>{title}</code>, <code>{location}</code>, <code>{color}</code>, <code>{icon}</code>, <code>{date}</code>, <code>{time}</code>.', 'my-calendar' ) ); ?></li>
664
- <li><?php mc_settings_field( 'mc_link_label', __( 'Event URL link text', 'my-calendar' ), $mc_link_label, "<a href='" . admin_url( 'admin.php?page=my-calendar-help#templates' ) . "'>" . __( 'Templating Help', 'my-calendar' ) . '</a>' ); ?></li>
665
  <li>
666
  <?php
667
  // Translators: Current title template (code).
@@ -709,13 +709,13 @@ function mc_remote_db() {
709
  <fieldset>
710
  <legend><?php _e( 'Calendar Link Targets', 'my-calendar' ); ?></legend>
711
  <ul>
712
- <?php
713
- $atts = array();
714
- $note = '';
715
- if ( '' === get_option( 'mc_uri_id', '' ) || '0' === get_option( 'mc_uri_id' ) ) {
716
- $atts = array( 'disabled' => 'disabled' );
717
- $note = ' (' . __( 'Set a main calendar page first.', 'my-calendar' ) . ')';
718
- }
719
  ?>
720
  <li><?php mc_settings_field( 'mc_open_uri', __( 'Open calendar links to event details', 'my-calendar' ), '', $note, $atts, 'checkbox-single' ); ?></li>
721
  <li><?php mc_settings_field( 'mc_no_link', __( 'Disable calendar links', 'my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
@@ -1082,7 +1082,7 @@ function mc_remote_db() {
1082
  'mc_event_mail_message',
1083
  __( 'Message Body', 'my-calendar' ),
1084
  __( 'New Event:', 'my-calendar' ) . "\n{title}: {date}, {time} - {event_status}",
1085
- "<br /><a href='" . admin_url( 'admin.php?page=my-calendar-help#templates' ) . "'>" . __( 'Templating Help', 'my-calendar' ) . '</a>',
1086
  array(
1087
  'cols' => 60,
1088
  'rows' => 6,
652
  <fieldset>
653
  <legend class="screen-reader-text"><?php _e( 'Customize Text Fields', 'my-calendar' ); ?></legend>
654
  <ul>
655
+ <li><?php mc_settings_field( 'mc_title_template', __( 'Event title (Grid)', 'my-calendar' ), $mc_title_template, "<a href='" . admin_url( 'admin.php?page=my-calendar-templates#templates' ) . "'>" . __( 'Templating Help', 'my-calendar' ) . '</a>' ); ?></li>
656
+ <li><?php mc_settings_field( 'mc_title_template_solo', __( 'Event title (Single)', 'my-calendar' ), $mc_title_template_solo, "<a href='" . admin_url( 'admin.php?page=my-calendar-templates#templates' ) . "'>" . __( 'Templating Help', 'my-calendar' ) . '</a>' ); ?></li>
657
+ <li><?php mc_settings_field( 'mc_title_template_list', __( 'Event title (List)', 'my-calendar' ), $mc_title_template_list, "<a href='" . admin_url( 'admin.php?page=my-calendar-templates#templates' ) . "'>" . __( 'Templating Help', 'my-calendar' ) . '</a>' ); ?></li>
658
  <li><?php mc_settings_field( 'mc_notime_text', __( 'Label for all-day events', 'my-calendar' ), 'All Day' ); ?></li>
659
  <li><?php mc_settings_field( 'mc_previous_events', __( 'Previous events link', 'my-calendar' ), __( 'Previous', 'my-calendar' ), __( 'Use <code>{date}</code> to display date in navigation.', 'my-calendar' ) ); ?></li>
660
  <li><?php mc_settings_field( 'mc_next_events', __( 'Next events link', 'my-calendar' ), __( 'Next', 'my-calendar' ), __( 'Use <code>{date}</code> to display date in navigation.', 'my-calendar' ) ); ?></li>
661
  <li><?php mc_settings_field( 'mc_week_caption', __( 'Week view caption:', 'my-calendar' ), '', __( 'Available tag: <code>{date format=""}</code>', 'my-calendar' ) ); ?></li>
662
  <li><?php mc_settings_field( 'mc_caption', __( 'Extended caption:', 'my-calendar' ), '', __( 'Follows month/year in list views.', 'my-calendar' ) ); ?></li>
663
  <li><?php mc_settings_field( 'mc_details_label', __( 'Event details link text', 'my-calendar' ), $mc_details_label, __( 'Tags: <code>{title}</code>, <code>{location}</code>, <code>{color}</code>, <code>{icon}</code>, <code>{date}</code>, <code>{time}</code>.', 'my-calendar' ) ); ?></li>
664
+ <li><?php mc_settings_field( 'mc_link_label', __( 'Event URL link text', 'my-calendar' ), $mc_link_label, "<a href='" . admin_url( 'admin.php?page=my-calendar-templates#templates' ) . "'>" . __( 'Templating Help', 'my-calendar' ) . '</a>' ); ?></li>
665
  <li>
666
  <?php
667
  // Translators: Current title template (code).
709
  <fieldset>
710
  <legend><?php _e( 'Calendar Link Targets', 'my-calendar' ); ?></legend>
711
  <ul>
712
+ <?php
713
+ $atts = array();
714
+ $note = '';
715
+ if ( '' === get_option( 'mc_uri_id', '' ) || '0' === get_option( 'mc_uri_id' ) ) {
716
+ $atts = array( 'disabled' => 'disabled' );
717
+ $note = ' (' . __( 'Set a main calendar page first.', 'my-calendar' ) . ')';
718
+ }
719
  ?>
720
  <li><?php mc_settings_field( 'mc_open_uri', __( 'Open calendar links to event details', 'my-calendar' ), '', $note, $atts, 'checkbox-single' ); ?></li>
721
  <li><?php mc_settings_field( 'mc_no_link', __( 'Disable calendar links', 'my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
1082
  'mc_event_mail_message',
1083
  __( 'Message Body', 'my-calendar' ),
1084
  __( 'New Event:', 'my-calendar' ) . "\n{title}: {date}, {time} - {event_status}",
1085
+ "<br /><a href='" . admin_url( 'admin.php?page=my-calendar-templates#templates' ) . "'>" . __( 'Templating Help', 'my-calendar' ) . '</a>',
1086
  array(
1087
  'cols' => 60,
1088
  'rows' => 6,
my-calendar-templates.php CHANGED
@@ -1139,7 +1139,7 @@ function mc_event_recur_string( $event, $begin ) {
1139
  $every = ( isset( $recurs[1] ) ) ? str_replace( $recurs[0], '', $event->event_recur ) : 1;
1140
  $month_date = mc_date( 'dS', strtotime( $begin ), false );
1141
  $day_name = date_i18n( 'l', strtotime( $begin ) );
1142
- $week_number = mc_ordinal( week_of_month( mc_date( 'j', strtotime( $begin ), false ) ) + 1 );
1143
  switch ( $recur ) {
1144
  case 'S':
1145
  $event_recur = __( 'Does not recur', 'my-calendar' );
1139
  $every = ( isset( $recurs[1] ) ) ? str_replace( $recurs[0], '', $event->event_recur ) : 1;
1140
  $month_date = mc_date( 'dS', strtotime( $begin ), false );
1141
  $day_name = date_i18n( 'l', strtotime( $begin ) );
1142
+ $week_number = mc_ordinal( mc_week_of_month( mc_date( 'j', strtotime( $begin ), false ) ) + 1 );
1143
  switch ( $recur ) {
1144
  case 'S':
1145
  $event_recur = __( 'Does not recur', 'my-calendar' );
my-calendar-templating.php CHANGED
@@ -81,7 +81,7 @@ function mc_templates_edit() {
81
  <h2><?php _e( 'Edit Template', 'my-calendar' ); ?></h2>
82
  <div class="inside">
83
  <p>
84
- <a href="<?php echo admin_url( 'admin.php?page=my-calendar-help#templates' ); ?>"><?php _e( 'Templates Help', 'my-calendar' ); ?></a> &raquo;
85
  </p>
86
  <?php echo ( '' !== $core ) ? "<p class='template-description'>$core</p>" : ''; ?>
87
  <?php
@@ -150,7 +150,7 @@ function mc_templates_edit() {
150
  <div class="metabox-holder">
151
  <div class="ui-sortable meta-box-sortables">
152
  <div class="postbox">
153
- <h2 class='hndle'><?php _e( 'Event Template Tags', 'my-calendar' ); ?></h2>
154
 
155
  <div class='mc_template_tags inside'>
156
  <p>
@@ -257,7 +257,7 @@ function mc_templates_edit() {
257
  <div id="templates" class="metabox-holder">
258
  <div class="ui-sortable meta-box-sortables">
259
  <div class="postbox">
260
- <h2 class='hndle'><?php _e( 'All Event Template Tags (alphabetical)', 'my-calendar' ); ?></h2>
261
 
262
  <div class='mc_template_tags inside'>
263
  <?php echo mc_display_template_tags(); ?>
81
  <h2><?php _e( 'Edit Template', 'my-calendar' ); ?></h2>
82
  <div class="inside">
83
  <p>
84
+ <a href="<?php echo admin_url( 'admin.php?page=my-calendar-templates#templates' ); ?>"><?php _e( 'Templates Help', 'my-calendar' ); ?></a> &raquo;
85
  </p>
86
  <?php echo ( '' !== $core ) ? "<p class='template-description'>$core</p>" : ''; ?>
87
  <?php
150
  <div class="metabox-holder">
151
  <div class="ui-sortable meta-box-sortables">
152
  <div class="postbox">
153
+ <h2><?php _e( 'Event Template Tags', 'my-calendar' ); ?></h2>
154
 
155
  <div class='mc_template_tags inside'>
156
  <p>
257
  <div id="templates" class="metabox-holder">
258
  <div class="ui-sortable meta-box-sortables">
259
  <div class="postbox">
260
+ <h2><?php _e( 'All Event Template Tags (alphabetical)', 'my-calendar' ); ?></h2>
261
 
262
  <div class='mc_template_tags inside'>
263
  <?php echo mc_display_template_tags(); ?>
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.10
21
  */
22
 
23
  /*
@@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
42
  }
43
 
44
  global $mc_version, $wpdb;
45
- $mc_version = '3.2.10';
46
 
47
  define( 'MC_DEBUG', false );
48
 
@@ -106,6 +106,7 @@ include( dirname( __FILE__ ) . '/my-calendar-templating.php' );
106
  include( dirname( __FILE__ ) . '/my-calendar-group-manager.php' );
107
  include( dirname( __FILE__ ) . '/my-calendar-api.php' );
108
  include( dirname( __FILE__ ) . '/my-calendar-generator.php' );
 
109
 
110
  add_action( 'plugins_loaded', 'mc_load_textdomain' );
111
  /**
@@ -236,7 +237,7 @@ function mc_show_sidebar( $show = '', $add = false, $remove = false ) {
236
  ?>
237
  <div class="ui-sortable meta-box-sortables">
238
  <div class="postbox">
239
- <h2 class='hndle'><?php echo $key; ?></h2>
240
 
241
  <div class='<?php echo sanitize_title( $key ); ?> inside'>
242
  <?php echo $value; ?>
@@ -251,7 +252,7 @@ function mc_show_sidebar( $show = '', $add = false, $remove = false ) {
251
  ?>
252
  <div class="ui-sortable meta-box-sortables">
253
  <div class="postbox sell support">
254
- <h2 class='sales hndle'><strong><?php _e( 'My Calendar Pro', 'my-calendar' ); ?></strong></h2>
255
 
256
  <div class="inside resources">
257
  <p class="mcbuy">
@@ -269,7 +270,7 @@ function mc_show_sidebar( $show = '', $add = false, $remove = false ) {
269
  ?>
270
  <div class="ui-sortable meta-box-sortables">
271
  <div class="postbox sell my-tickets">
272
- <h2 class='sales hndle'><strong><?php _e( 'My Tickets', 'my-calendar' ); ?></strong></h2>
273
 
274
  <div class="inside resources">
275
  <p class="mcbuy">
@@ -288,7 +289,7 @@ function mc_show_sidebar( $show = '', $add = false, $remove = false ) {
288
  ?>
289
  <div class="ui-sortable meta-box-sortables">
290
  <div class="postbox support">
291
- <h2 class='hndle'><strong><?php _e( 'Support This Plug-in', 'my-calendar' ); ?></strong></h2>
292
 
293
  <div class="inside resources">
294
  <p class="follow-me">
@@ -321,7 +322,7 @@ function mc_show_sidebar( $show = '', $add = false, $remove = false ) {
321
  ?>
322
  <div class="ui-sortable meta-box-sortables">
323
  <div class="postbox">
324
- <h2 class='hndle'><?php _e( 'Get Help', 'my-calendar' ); ?></h2>
325
 
326
  <div class="inside">
327
  <ul>
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.11
21
  */
22
 
23
  /*
42
  }
43
 
44
  global $mc_version, $wpdb;
45
+ $mc_version = '3.2.11';
46
 
47
  define( 'MC_DEBUG', false );
48
 
106
  include( dirname( __FILE__ ) . '/my-calendar-group-manager.php' );
107
  include( dirname( __FILE__ ) . '/my-calendar-api.php' );
108
  include( dirname( __FILE__ ) . '/my-calendar-generator.php' );
109
+ include( dirname( __FILE__ ) . '/my-calendar-call-template.php' );
110
 
111
  add_action( 'plugins_loaded', 'mc_load_textdomain' );
112
  /**
237
  ?>
238
  <div class="ui-sortable meta-box-sortables">
239
  <div class="postbox">
240
+ <h2><?php echo $key; ?></h2>
241
 
242
  <div class='<?php echo sanitize_title( $key ); ?> inside'>
243
  <?php echo $value; ?>
252
  ?>
253
  <div class="ui-sortable meta-box-sortables">
254
  <div class="postbox sell support">
255
+ <h2 class='sales'><strong><?php _e( 'My Calendar Pro', 'my-calendar' ); ?></strong></h2>
256
 
257
  <div class="inside resources">
258
  <p class="mcbuy">
270
  ?>
271
  <div class="ui-sortable meta-box-sortables">
272
  <div class="postbox sell my-tickets">
273
+ <h2 class='sales'><strong><?php _e( 'My Tickets', 'my-calendar' ); ?></strong></h2>
274
 
275
  <div class="inside resources">
276
  <p class="mcbuy">
289
  ?>
290
  <div class="ui-sortable meta-box-sortables">
291
  <div class="postbox support">
292
+ <h2><strong><?php _e( 'Support This Plug-in', 'my-calendar' ); ?></strong></h2>
293
 
294
  <div class="inside resources">
295
  <p class="follow-me">
322
  ?>
323
  <div class="ui-sortable meta-box-sortables">
324
  <div class="postbox">
325
+ <h2><?php _e( 'Get Help', 'my-calendar' ); ?></h2>
326
 
327
  <div class="inside">
328
  <ul>
readme.txt CHANGED
@@ -3,10 +3,10 @@ Contributors: joedolson
3
  Donate link: http://www.joedolson.com/donate/
4
  Tags: calendar, dates, times, event, events, scheduling, schedule, event manager, event calendar, class, concert, venue, location, box office, tickets, registration
5
  Requires at least: 4.4
6
- Tested up to: 5.5
7
  Requires PHP: 5.6
8
- Stable tag: 3.2.10
9
  Text domain: my-calendar
 
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,17 @@ Translating my plug-ins is always appreciated. Visit <a href="https://translate.
84
 
85
  == Changelog ==
86
 
 
 
 
 
 
 
 
 
 
 
 
87
  = 3.2.10 =
88
 
89
  * Change: Fallback text should have a stylable wrapper.
3
  Donate link: http://www.joedolson.com/donate/
4
  Tags: calendar, dates, times, event, events, scheduling, schedule, event manager, event calendar, class, concert, venue, location, box office, tickets, registration
5
  Requires at least: 4.4
6
+ Tested up to: 5.6
7
  Requires PHP: 5.6
 
8
  Text domain: my-calendar
9
+ Stable tag: 3.2.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.2.11 =
88
+
89
+ * Bug fix: switching to week view display broken.
90
+ * Bug fix: links to template help pointed to old location for help.
91
+ * Bug fix: AJAX nav pulled height from first rendered calendar, not current navigating calendar.
92
+ * Change: filter to pass custom notices for front end submissions and editing.
93
+ * Remove fallback function for is_ssl()
94
+ * Improve conflicting event errors when the conflicting event is still unpublished.
95
+ * Add custom template to pass a calendar that's embeddable via iframe.
96
+ * Bug fix: Multisite environments need to use navigation on current site, not from remote site.
97
+
98
  = 3.2.10 =
99
 
100
  * Change: Fallback text should have a stylable wrapper.
templates/my-calendar-template.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * My Calendar embed template.
4
+ *
5
+ * @category Templates
6
+ * @package My Calendar
7
+ * @author Joe Dolson
8
+ * @license GPLv2 or later
9
+ * @link https://www.joedolson.com/my-calendar/
10
+ */
11
+
12
+ ?>
13
+ <!DOCTYPE html>
14
+ <html <?php language_attributes(); ?>>
15
+ <head>
16
+ <title><?php the_title(); ?></title>
17
+ <?php wp_head(); ?>
18
+ </head>
19
+ <body>
20
+ <?php
21
+ the_content();
22
+ wp_footer();
23
+ ?>
24
+ </body>
25
+ </html>