Version Description
- Bug fix: missing space in conflict identification
- Bug fix: internationalization of string to time created conflict when entering month abbreviations
- Add filter to enable creation of a custom content editor
Download this release
Release Info
Developer | joedolson |
Plugin | My Calendar |
Version | 2.5.12 |
Comparing to | |
See all releases |
Code changes from version 2.5.11 to 2.5.12
- js/jquery.public.js +19 -0
- my-calendar-event-manager.php +32 -26
- my-calendar-install.php +1 -1
- my-calendar-output.php +1 -0
- my-calendar.php +2 -2
- readme.txt +10 -3
js/jquery.public.js
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function ($) {
|
2 |
+
$(function () {
|
3 |
+
// Delete single instances of recurring events.
|
4 |
+
$( '.mc_response' ).hide();
|
5 |
+
$('button.delete_occurrence').on( 'click', function () {
|
6 |
+
var value = $(this).attr( 'data-value' );
|
7 |
+
var data = {
|
8 |
+
'action': mc_data.action,
|
9 |
+
'occur_id': value,
|
10 |
+
'security': mc_data.security
|
11 |
+
};
|
12 |
+
$.post( ajaxurl, data, function (response) {
|
13 |
+
if ( response.success == 1 ) {
|
14 |
+
$( "button[data-value='"+value+"']" ).parent( 'li' ).hide();
|
15 |
+
}
|
16 |
+
$('.mc_response').text( response.response ).show( 300 );
|
17 |
+
}, "json" );
|
18 |
+
});
|
19 |
+
}(jQuery));
|
my-calendar-event-manager.php
CHANGED
@@ -53,6 +53,7 @@ function mc_event_post( $action, $data, $event_id ) {
|
|
53 |
if ( $data['event_image'] == '' ) {
|
54 |
delete_post_thumbnail( $post_id );
|
55 |
} else {
|
|
|
56 |
$attachment_id = ( isset( $_POST['event_image_id'] ) && is_numeric( $_POST['event_image_id'] ) ) ? $_POST['event_image_id'] : false;
|
57 |
if ( $attachment_id ) {
|
58 |
set_post_thumbnail( $post_id, $attachment_id );
|
@@ -831,21 +832,26 @@ function mc_show_block( $field, $has_data, $data, $echo = true, $default = '' )
|
|
831 |
global $current_screen;
|
832 |
// because wp_editor cannot return a value, event_desc fields cannot be filtered if its enabled.
|
833 |
$value = ( $has_data ) ? stripslashes( $data->event_desc ) : '';
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
<textarea id="content" name="content" class="event_desc" rows="8" cols="80">' . stripslashes( esc_attr( $value ) ) . '</textarea>
|
838 |
-
</div>';
|
839 |
} else {
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
} else {
|
846 |
-
echo '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
847 |
}
|
848 |
-
echo '</div>';
|
849 |
}
|
850 |
}
|
851 |
break;
|
@@ -2365,7 +2371,7 @@ function mcs_check_conflicts( $begin, $time, $end, $endtime, $event_label ) {
|
|
2365 |
$event_query = "SELECT occur_id
|
2366 |
FROM " . my_calendar_table() . "
|
2367 |
ON ( " . my_calendar_event_table() . "
|
2368 |
-
|
2369 |
WHERE $select_location
|
2370 |
( occur_begin BETWEEN '$begin $time'AND '$end $endtime'OR occur_end BETWEEN '$begin $time'AND '$end $endtime')";
|
2371 |
$results = $wpdb->get_results( $event_query );
|
@@ -2645,7 +2651,7 @@ function mc_post_update_event( $id ) {
|
|
2645 |
/**
|
2646 |
* Parse a string and replace internationalized months with English so strtotime() will parse correctly
|
2647 |
*/
|
2648 |
-
function mc_strtotime( $string ) {
|
2649 |
$months = array(
|
2650 |
date_i18n( 'F', strtotime( 'January 1' ) ),
|
2651 |
date_i18n( 'F', strtotime( 'February 1' ) ),
|
@@ -2685,20 +2691,20 @@ function mc_strtotime( $string ) {
|
|
2685 |
'October',
|
2686 |
'November',
|
2687 |
'December',
|
2688 |
-
'
|
2689 |
-
'
|
2690 |
-
'
|
2691 |
-
'
|
2692 |
'May',
|
2693 |
-
'
|
2694 |
-
'
|
2695 |
-
'
|
2696 |
-
'
|
2697 |
-
'
|
2698 |
-
'
|
2699 |
-
'
|
2700 |
);
|
2701 |
-
|
2702 |
return strtotime( str_replace( $months, $english, $string ) );
|
2703 |
|
2704 |
}
|
53 |
if ( $data['event_image'] == '' ) {
|
54 |
delete_post_thumbnail( $post_id );
|
55 |
} else {
|
56 |
+
// check POST data
|
57 |
$attachment_id = ( isset( $_POST['event_image_id'] ) && is_numeric( $_POST['event_image_id'] ) ) ? $_POST['event_image_id'] : false;
|
58 |
if ( $attachment_id ) {
|
59 |
set_post_thumbnail( $post_id, $attachment_id );
|
832 |
global $current_screen;
|
833 |
// because wp_editor cannot return a value, event_desc fields cannot be filtered if its enabled.
|
834 |
$value = ( $has_data ) ? stripslashes( $data->event_desc ) : '';
|
835 |
+
$custom_editor = apply_filters( 'mc_custom_content_editor', false, $value, $data );
|
836 |
+
if ( $custom_editor !== false ) {
|
837 |
+
$return = $custom_editor;
|
|
|
|
|
838 |
} else {
|
839 |
+
if ( $current_screen->base == 'post' ) {
|
840 |
+
$return = '<div class="event_description">
|
841 |
+
<label for="content" class="screen-reader-text">' . __( 'Event Description', 'my-calendar' ) . '</label>
|
842 |
+
<textarea id="content" name="content" class="event_desc" rows="8" cols="80">' . stripslashes( esc_attr( $value ) ) . '</textarea>
|
843 |
+
</div>';
|
844 |
} else {
|
845 |
+
echo '
|
846 |
+
<div class="event_description">
|
847 |
+
<label for="content" class="screen-reader-text">' . __( 'Event Description', 'my-calendar' ) . '</label>';
|
848 |
+
if ( user_can_richedit() ) {
|
849 |
+
wp_editor( $value, 'content', array( 'textarea_rows' => 10 ) );
|
850 |
+
} else {
|
851 |
+
echo '<textarea id="content" name="content" class="event_desc" rows="8" cols="80">' . stripslashes( esc_attr( $value ) ) . '</textarea>';
|
852 |
+
}
|
853 |
+
echo '</div>';
|
854 |
}
|
|
|
855 |
}
|
856 |
}
|
857 |
break;
|
2371 |
$event_query = "SELECT occur_id
|
2372 |
FROM " . my_calendar_table() . "
|
2373 |
ON ( " . my_calendar_event_table() . "
|
2374 |
+
JOIN event_id=occur_event_id)
|
2375 |
WHERE $select_location
|
2376 |
( occur_begin BETWEEN '$begin $time'AND '$end $endtime'OR occur_end BETWEEN '$begin $time'AND '$end $endtime')";
|
2377 |
$results = $wpdb->get_results( $event_query );
|
2651 |
/**
|
2652 |
* Parse a string and replace internationalized months with English so strtotime() will parse correctly
|
2653 |
*/
|
2654 |
+
function mc_strtotime( $string ) {
|
2655 |
$months = array(
|
2656 |
date_i18n( 'F', strtotime( 'January 1' ) ),
|
2657 |
date_i18n( 'F', strtotime( 'February 1' ) ),
|
2691 |
'October',
|
2692 |
'November',
|
2693 |
'December',
|
2694 |
+
'Jan',
|
2695 |
+
'Feb',
|
2696 |
+
'Mar',
|
2697 |
+
'Apr',
|
2698 |
'May',
|
2699 |
+
'Jun',
|
2700 |
+
'Jul',
|
2701 |
+
'Aug',
|
2702 |
+
'Sep',
|
2703 |
+
'Oct',
|
2704 |
+
'Nov',
|
2705 |
+
'Dec'
|
2706 |
);
|
2707 |
+
|
2708 |
return strtotime( str_replace( $months, $english, $string ) );
|
2709 |
|
2710 |
}
|
my-calendar-install.php
CHANGED
@@ -238,7 +238,7 @@ function mc_default_settings() {
|
|
238 |
'mini' => $mini_template,
|
239 |
'rss' => $rss_template,
|
240 |
'details' => $single_template,
|
241 |
-
'label' => addslashes( 'More<span class="screen-reader-text"> about {title}</span>' )
|
242 |
) );
|
243 |
add_option( 'mc_skip_holidays', 'false' );
|
244 |
add_option( 'mc_css_file', 'twentyfifteen.css' );
|
238 |
'mini' => $mini_template,
|
239 |
'rss' => $rss_template,
|
240 |
'details' => $single_template,
|
241 |
+
'label' => addslashes( __( 'More<span class="screen-reader-text"> about {title}</span>', 'my-calendar' ) )
|
242 |
) );
|
243 |
add_option( 'mc_skip_holidays', 'false' );
|
244 |
add_option( 'mc_css_file', 'twentyfifteen.css' );
|
my-calendar-output.php
CHANGED
@@ -1426,6 +1426,7 @@ function my_calendar( $name, $format, $category, $time = 'month', $ltype = '', $
|
|
1426 |
$list_heading = jd_draw_template( $values, stripslashes( get_option( 'mc_week_caption' ) ) );
|
1427 |
}
|
1428 |
$h2 = apply_filters( 'mc_list_header_level', 'h2' );
|
|
|
1429 |
$my_calendar_body .= "<$h2 class=\"heading my-calendar-$time\">$list_heading</$h2>\n";
|
1430 |
}
|
1431 |
// If not a valid time or layout format, skip.
|
1426 |
$list_heading = jd_draw_template( $values, stripslashes( get_option( 'mc_week_caption' ) ) );
|
1427 |
}
|
1428 |
$h2 = apply_filters( 'mc_list_header_level', 'h2' );
|
1429 |
+
$list_heading = apply_filters( 'mc_list_heading', $list_heading, $current_month_header, $through_month_header, $caption_text );
|
1430 |
$my_calendar_body .= "<$h2 class=\"heading my-calendar-$time\">$list_heading</$h2>\n";
|
1431 |
}
|
1432 |
// If not a valid time or layout format, skip.
|
my-calendar.php
CHANGED
@@ -7,7 +7,7 @@ Author: Joseph C Dolson
|
|
7 |
Author URI: http://www.joedolson.com
|
8 |
Text Domain: my-calendar
|
9 |
Domain Path: lang
|
10 |
-
Version: 2.5.
|
11 |
*/
|
12 |
/* Copyright 2009-2017 Joe Dolson (email : joe@joedolson.com)
|
13 |
|
@@ -30,7 +30,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
30 |
} // Exit if accessed directly
|
31 |
|
32 |
global $mc_version, $wpdb;
|
33 |
-
$mc_version = '2.5.
|
34 |
|
35 |
register_activation_hook( __FILE__, 'mc_plugin_activated' );
|
36 |
register_deactivation_hook( __FILE__, 'mc_plugin_deactivated' );
|
7 |
Author URI: http://www.joedolson.com
|
8 |
Text Domain: my-calendar
|
9 |
Domain Path: lang
|
10 |
+
Version: 2.5.12
|
11 |
*/
|
12 |
/* Copyright 2009-2017 Joe Dolson (email : joe@joedolson.com)
|
13 |
|
30 |
} // Exit if accessed directly
|
31 |
|
32 |
global $mc_version, $wpdb;
|
33 |
+
$mc_version = '2.5.12';
|
34 |
|
35 |
register_activation_hook( __FILE__, 'mc_plugin_activated' );
|
36 |
register_deactivation_hook( __FILE__, 'mc_plugin_deactivated' );
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ 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: 4.
|
7 |
-
Stable tag: 2.5.
|
8 |
Text domain: my-calendar
|
9 |
License: GPLv2 or later
|
10 |
|
@@ -80,9 +80,15 @@ Translating my plug-ins is always appreciated. Visit <a href="https://translate.
|
|
80 |
4. Edit or create a page on your blog which includes the shortcode [my_calendar] and visit
|
81 |
the page you have edited or created. You should see your calendar. Visit My Calendar -> Help for assistance
|
82 |
with shortcode options or widget configuration.
|
83 |
-
|
84 |
== Changelog ==
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
= 2.5.11 =
|
87 |
|
88 |
* Bug fix: Bottom mass action buttons outside of form
|
@@ -840,6 +846,7 @@ This is a major revision.
|
|
840 |
* Event occurrence IDs can change when events dates are changed
|
841 |
* Add option to insert events simultaneously to both global & local calendar in multisite networks [todo]
|
842 |
* JS to delete events from front-end when logged-in
|
|
|
843 |
|
844 |
== Frequently Asked Questions ==
|
845 |
|
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: 4.8
|
7 |
+
Stable tag: 2.5.11
|
8 |
Text domain: my-calendar
|
9 |
License: GPLv2 or later
|
10 |
|
80 |
4. Edit or create a page on your blog which includes the shortcode [my_calendar] and visit
|
81 |
the page you have edited or created. You should see your calendar. Visit My Calendar -> Help for assistance
|
82 |
with shortcode options or widget configuration.
|
83 |
+
|
84 |
== Changelog ==
|
85 |
|
86 |
+
= 2.5.12 =
|
87 |
+
|
88 |
+
* Bug fix: missing space in conflict identification
|
89 |
+
* Bug fix: internationalization of string to time created conflict when entering month abbreviations
|
90 |
+
* Add filter to enable creation of a custom content editor
|
91 |
+
|
92 |
= 2.5.11 =
|
93 |
|
94 |
* Bug fix: Bottom mass action buttons outside of form
|
846 |
* Event occurrence IDs can change when events dates are changed
|
847 |
* Add option to insert events simultaneously to both global & local calendar in multisite networks [todo]
|
848 |
* JS to delete events from front-end when logged-in
|
849 |
+
* TODO: delete this instance and all subsequent instances
|
850 |
|
851 |
== Frequently Asked Questions ==
|
852 |
|