Version Description
- fixed some instances where PHP 5.2 outputs incorrect times due to other plugins changing server timezones
- fixed scope issues with PHP 5.2 when calculating start/end of month dates
- fixed potential issues with manual offsets when other plugins change server timezones whilst saving events, particularly in PHP 5.2
- added EM_CACHE constant which if defined as false will disable caching
- fixed issues when changing times of an EM_DateTime object with large manual offset timezones may cause incorrect dates (fixes some weekly recurrence pattern issues)
- added notice when viewing bookings made in another language
- added booking admin table column for language used in booking
- fixed some minor PHP notices preventing event submissions/edits with a new location if display_errors are enabled
- updated EM_Notices to use new class names for notices output in WP Dasbhoard
- added filters for all post type and custom taxonomy arrays used in initial post type and custom taxonomy registration functions (see em-posts.php)
Download this release
Release Info
Developer | netweblogic |
Plugin | Events Manager |
Version | 5.9.2 |
Comparing to | |
See all releases |
Code changes from version 5.9.1 to 5.9.2
- classes/em-datetime.php +47 -4
- classes/em-event-post-admin.php +8 -1
- classes/em-event.php +5 -5
- classes/em-location.php +3 -3
- classes/em-notices.php +4 -4
- classes/em-tickets.php +5 -1
- em-actions.php +5 -0
- em-posts.php +12 -12
- events-manager.php +2 -2
- multilingual/em-ml-bookings.php +33 -1
- readme.txt +14 -1
classes/em-datetime.php
CHANGED
@@ -80,7 +80,14 @@ class EM_DateTime extends DateTime {
|
|
80 |
if( !$this->valid && ($format == 'Y-m-d' || $format == em_get_date_format())) return '';
|
81 |
//if we deal with offsets, then we offset UTC time by that much
|
82 |
if( $this->timezone_manual_offset !== false ){
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
}
|
85 |
return parent::format($format);
|
86 |
}
|
@@ -105,7 +112,14 @@ class EM_DateTime extends DateTime {
|
|
105 |
public function i18n( $format = 'Y-m-d H:i:s' ){
|
106 |
if( !$this->valid && $format == em_get_date_format()) return '';
|
107 |
//if we deal with offsets, then we offset UTC time by that much
|
108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
}
|
110 |
|
111 |
/**
|
@@ -174,7 +188,23 @@ class EM_DateTime extends DateTime {
|
|
174 |
* @see DateTime::setTime()
|
175 |
*/
|
176 |
public function setTime( $hour, $minute, $second = NULL, $microseconds = NULL ){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
$return = parent::setTime( $hour, $minute, $second );
|
|
|
|
|
|
|
|
|
178 |
$this->handleOffsets();
|
179 |
$this->valid = $return !== false;
|
180 |
return $this;
|
@@ -231,7 +261,12 @@ class EM_DateTime extends DateTime {
|
|
231 |
$this->valid = $result !== false;
|
232 |
}else{
|
233 |
//PHP < 5.3 fallback :/ wierd stuff happens when using the DateTime modify function
|
234 |
-
|
|
|
|
|
|
|
|
|
|
|
235 |
$this->valid = $timestamp !== false;
|
236 |
if( $this->valid ) $this->setTimestamp( $timestamp );
|
237 |
}
|
@@ -336,6 +371,9 @@ class EM_DateTime extends DateTime {
|
|
336 |
//PHP < 5.3 fallback :/
|
337 |
$strtotime = parent::format('Y-m-d H:i:s');
|
338 |
$timestamp = strtotime($strtotime);
|
|
|
|
|
|
|
339 |
return $timestamp;
|
340 |
}
|
341 |
}
|
@@ -349,7 +387,12 @@ class EM_DateTime extends DateTime {
|
|
349 |
public function getTimestampWithOffset( $server_localized = false ){
|
350 |
//aside from the actual offset from the timezone, we also have a local server offset we need to deal with here...
|
351 |
$server_offset = $server_localized ? date('Z',$this->getTimestamp()) : 0;
|
352 |
-
|
|
|
|
|
|
|
|
|
|
|
353 |
}
|
354 |
|
355 |
/**
|
80 |
if( !$this->valid && ($format == 'Y-m-d' || $format == em_get_date_format())) return '';
|
81 |
//if we deal with offsets, then we offset UTC time by that much
|
82 |
if( $this->timezone_manual_offset !== false ){
|
83 |
+
if( function_exists('date_timestamp_get') ){
|
84 |
+
return date($format, $this->getTimestampWithOffset(true) );
|
85 |
+
}else{
|
86 |
+
//PHP < 5.3 fallback :/ Messed up, but it works...
|
87 |
+
$timestamp = parent::format('U');
|
88 |
+
$server_offset = date('Z', $timestamp);
|
89 |
+
return date( $format, $timestamp - ($server_offset * 2) + $this->getOffset() );
|
90 |
+
}
|
91 |
}
|
92 |
return parent::format($format);
|
93 |
}
|
112 |
public function i18n( $format = 'Y-m-d H:i:s' ){
|
113 |
if( !$this->valid && $format == em_get_date_format()) return '';
|
114 |
//if we deal with offsets, then we offset UTC time by that much
|
115 |
+
if( !function_exists('date_timestamp_get') && $this->timezone_manual_offset !== false ){
|
116 |
+
//PHP < 5.3 fallback :/ Messed up, but it works...
|
117 |
+
$timestamp = parent::format('U');
|
118 |
+
$server_offset = date('Z', $timestamp);
|
119 |
+
return date_i18n( $format, $timestamp - ($server_offset * 2) + $this->getOffset() );
|
120 |
+
}else{
|
121 |
+
return date_i18n( $format, $this->getTimestampWithOffset(true) );
|
122 |
+
}
|
123 |
}
|
124 |
|
125 |
/**
|
188 |
* @see DateTime::setTime()
|
189 |
*/
|
190 |
public function setTime( $hour, $minute, $second = NULL, $microseconds = NULL ){
|
191 |
+
/*
|
192 |
+
* manual offsets stores internal timestamp and date as UTC and the time is changed in UTC date/time
|
193 |
+
* this causes problems when UTC time is on a different date to the local time with manual offset.
|
194 |
+
* example: 2018-01-01 14:00 UTC => 2018-01-02 00:00 UTC+10
|
195 |
+
* action: set the time to 12:00
|
196 |
+
* result: 2018-01-01 02:00 UTC => 2018-01-01 12:00 UTC+10 -> after offset handling
|
197 |
+
* expected: 2018-01-02 02:00 UTC => 2018-01-02 12:00 UTC+10 -> after offset handling
|
198 |
+
* solution : change date AFTER setting the time and BEFORE offset handling
|
199 |
+
*/
|
200 |
+
if( $this->timezone_manual_offset !== false ){
|
201 |
+
$date_array = explode('-', $this->format('Y-m-d'));
|
202 |
+
}
|
203 |
$return = parent::setTime( $hour, $minute, $second );
|
204 |
+
//pre-handle offsets for time changes where dates change as stated above
|
205 |
+
if( $this->timezone_manual_offset !== false ){
|
206 |
+
$this->setDate($date_array[0], $date_array[1], $date_array[2]);
|
207 |
+
}
|
208 |
$this->handleOffsets();
|
209 |
$this->valid = $return !== false;
|
210 |
return $this;
|
261 |
$this->valid = $result !== false;
|
262 |
}else{
|
263 |
//PHP < 5.3 fallback :/ wierd stuff happens when using the DateTime modify function
|
264 |
+
if( preg_match('/^(first|last) day of this month$/', $modify, $matches) ){
|
265 |
+
$format = $matches[1] == 'first' ? 'Y-m-01':'Y-m-t';
|
266 |
+
$timestamp = strtotime($this->format( $format ), $this->getTimestamp());
|
267 |
+
}else{
|
268 |
+
$timestamp = strtotime($modify, $this->getTimestamp());
|
269 |
+
}
|
270 |
$this->valid = $timestamp !== false;
|
271 |
if( $this->valid ) $this->setTimestamp( $timestamp );
|
272 |
}
|
371 |
//PHP < 5.3 fallback :/
|
372 |
$strtotime = parent::format('Y-m-d H:i:s');
|
373 |
$timestamp = strtotime($strtotime);
|
374 |
+
//offset timestamp in case plugins change default timezone
|
375 |
+
$server_offset = date('Z',$timestamp);
|
376 |
+
$timestamp += $server_offset;
|
377 |
return $timestamp;
|
378 |
}
|
379 |
}
|
387 |
public function getTimestampWithOffset( $server_localized = false ){
|
388 |
//aside from the actual offset from the timezone, we also have a local server offset we need to deal with here...
|
389 |
$server_offset = $server_localized ? date('Z',$this->getTimestamp()) : 0;
|
390 |
+
if( function_exists('date_timestamp_get') ){
|
391 |
+
return $this->getOffset() + $this->getTimestamp() - $server_offset;
|
392 |
+
}else{
|
393 |
+
//PHP < 5.3 fallback :/
|
394 |
+
return $this->getTimestamp() - $server_offset;
|
395 |
+
}
|
396 |
}
|
397 |
|
398 |
/**
|
classes/em-event-post-admin.php
CHANGED
@@ -104,8 +104,13 @@ class EM_Event_Post_Admin{
|
|
104 |
$saving_status = !in_array(get_post_status($post_id), array('trash','auto-draft')) && !defined('DOING_AUTOSAVE');
|
105 |
$EM_EVENT_SAVE_POST = true; //first filter for save_post in EM for events
|
106 |
if(!defined('UNTRASHING_'.$post_id) && $is_post_type && $saving_status ){
|
107 |
-
|
|
|
|
|
|
|
|
|
108 |
$EM_Event->post_type = $post_type;
|
|
|
109 |
if( !empty($_REQUEST['_emnonce']) && wp_verify_nonce($_REQUEST['_emnonce'], 'edit_event') ){
|
110 |
//this is only run if we know form data was submitted, hence the nonce
|
111 |
$get_meta = $EM_Event->get_post_meta();
|
@@ -185,6 +190,8 @@ class EM_Event_Post_Admin{
|
|
185 |
}
|
186 |
}
|
187 |
self::maybe_publish_location($EM_Event);
|
|
|
|
|
188 |
}
|
189 |
}
|
190 |
|
104 |
$saving_status = !in_array(get_post_status($post_id), array('trash','auto-draft')) && !defined('DOING_AUTOSAVE');
|
105 |
$EM_EVENT_SAVE_POST = true; //first filter for save_post in EM for events
|
106 |
if(!defined('UNTRASHING_'.$post_id) && $is_post_type && $saving_status ){
|
107 |
+
//Reset server timezone to UTC in case other plugins are doing something naughty
|
108 |
+
$server_timezone = date_default_timezone_get();
|
109 |
+
date_default_timezone_set('UTC');
|
110 |
+
//grab event, via post info, reset the $EM_Event variable
|
111 |
+
$EM_Event = new EM_Event($post_id, 'post_id');
|
112 |
$EM_Event->post_type = $post_type;
|
113 |
+
//check whether this is a quick save or not, then save accordingly
|
114 |
if( !empty($_REQUEST['_emnonce']) && wp_verify_nonce($_REQUEST['_emnonce'], 'edit_event') ){
|
115 |
//this is only run if we know form data was submitted, hence the nonce
|
116 |
$get_meta = $EM_Event->get_post_meta();
|
190 |
}
|
191 |
}
|
192 |
self::maybe_publish_location($EM_Event);
|
193 |
+
//Set server timezone back, even though it should be UTC anyway
|
194 |
+
date_default_timezone_set($server_timezone);
|
195 |
}
|
196 |
}
|
197 |
|
classes/em-event.php
CHANGED
@@ -21,7 +21,7 @@ function em_get_event($id = false, $search_by = 'event_id') {
|
|
21 |
}
|
22 |
if( is_object($id) && get_class($id) == 'EM_Event' ){
|
23 |
return apply_filters('em_get_event', $id);
|
24 |
-
}
|
25 |
//check the cache first
|
26 |
$event_id = false;
|
27 |
if( is_numeric($id) ){
|
@@ -39,9 +39,9 @@ function em_get_event($id = false, $search_by = 'event_id') {
|
|
39 |
return apply_filters('em_get_event', $event);
|
40 |
}
|
41 |
}
|
42 |
-
//if we get this far, just create a new event
|
43 |
-
return apply_filters('em_get_event', new EM_Event($id,$search_by));
|
44 |
}
|
|
|
|
|
45 |
}
|
46 |
/**
|
47 |
* Event Object. This holds all the info pertaining to an event, including location and recurrence info.
|
@@ -2823,7 +2823,7 @@ class EM_Event extends EM_Object{
|
|
2823 |
$matching_days = array(); //the days we'll be returning in timestamps
|
2824 |
|
2825 |
//generate matching dates based on frequency type
|
2826 |
-
switch ( $this->recurrence_freq ){
|
2827 |
case 'daily':
|
2828 |
//If daily, it's simple. Get start date, add interval timestamps to that and create matching day for each interval until end date.
|
2829 |
$current_date = $start_date;
|
@@ -2883,7 +2883,7 @@ class EM_Event extends EM_Object{
|
|
2883 |
}
|
2884 |
//if we have a matching day, get the timestamp, make sure it's within our start/end dates for the event, and add to array if it is
|
2885 |
if( !empty($matching_day) ){
|
2886 |
-
$matching_date = $current_date->
|
2887 |
if($matching_date >= $start_date && $matching_date <= $end_date){
|
2888 |
$matching_days[] = $matching_date;
|
2889 |
}
|
21 |
}
|
22 |
if( is_object($id) && get_class($id) == 'EM_Event' ){
|
23 |
return apply_filters('em_get_event', $id);
|
24 |
+
}elseif( !defined('EM_CACHE') || EM_CACHE ){
|
25 |
//check the cache first
|
26 |
$event_id = false;
|
27 |
if( is_numeric($id) ){
|
39 |
return apply_filters('em_get_event', $event);
|
40 |
}
|
41 |
}
|
|
|
|
|
42 |
}
|
43 |
+
//if we get this far, just create a new event
|
44 |
+
return apply_filters('em_get_event', new EM_Event($id,$search_by));
|
45 |
}
|
46 |
/**
|
47 |
* Event Object. This holds all the info pertaining to an event, including location and recurrence info.
|
2823 |
$matching_days = array(); //the days we'll be returning in timestamps
|
2824 |
|
2825 |
//generate matching dates based on frequency type
|
2826 |
+
switch ( $this->recurrence_freq ){ /* @var EM_DateTime $current_date */
|
2827 |
case 'daily':
|
2828 |
//If daily, it's simple. Get start date, add interval timestamps to that and create matching day for each interval until end date.
|
2829 |
$current_date = $start_date;
|
2883 |
}
|
2884 |
//if we have a matching day, get the timestamp, make sure it's within our start/end dates for the event, and add to array if it is
|
2885 |
if( !empty($matching_day) ){
|
2886 |
+
$matching_date = $current_date->setDate( $current_date->format('Y'), $current_date->format('m'), $matching_day )->getTimestamp();
|
2887 |
if($matching_date >= $start_date && $matching_date <= $end_date){
|
2888 |
$matching_days[] = $matching_date;
|
2889 |
}
|
classes/em-location.php
CHANGED
@@ -21,7 +21,7 @@ function em_get_location($id = false, $search_by = 'location_id') {
|
|
21 |
}
|
22 |
if( is_object($id) && get_class($id) == 'EM_Location' ){
|
23 |
return apply_filters('em_get_location', $id);
|
24 |
-
}
|
25 |
//check the cache first
|
26 |
$location_id = false;
|
27 |
if( is_numeric($id) ){
|
@@ -39,8 +39,8 @@ function em_get_location($id = false, $search_by = 'location_id') {
|
|
39 |
return apply_filters('em_get_location', $location);
|
40 |
}
|
41 |
}
|
42 |
-
return apply_filters('em_get_location', new EM_Location($id,$search_by));
|
43 |
}
|
|
|
44 |
}
|
45 |
/**
|
46 |
* Object that holds location info and related functions
|
@@ -392,7 +392,7 @@ class EM_Location extends EM_Object {
|
|
392 |
//cache refresh when saving via admin area is handled in EM_Event_Post_Admin::save_post/refresh_cache
|
393 |
if( $post_save && $meta_save && $this->is_published() ){
|
394 |
//we won't depend on hooks, if we saved the event and it's still published in its saved state, refresh the cache regardless
|
395 |
-
$this->load_postdata($
|
396 |
wp_cache_set($this->location_id, $this, 'em_locations');
|
397 |
wp_cache_set($this->post_id, $this->location_id, 'em_locations_ids');
|
398 |
}
|
21 |
}
|
22 |
if( is_object($id) && get_class($id) == 'EM_Location' ){
|
23 |
return apply_filters('em_get_location', $id);
|
24 |
+
}elseif( !defined('EM_CACHE') || EM_CACHE ){
|
25 |
//check the cache first
|
26 |
$location_id = false;
|
27 |
if( is_numeric($id) ){
|
39 |
return apply_filters('em_get_location', $location);
|
40 |
}
|
41 |
}
|
|
|
42 |
}
|
43 |
+
return apply_filters('em_get_location', new EM_Location($id,$search_by));
|
44 |
}
|
45 |
/**
|
46 |
* Object that holds location info and related functions
|
392 |
//cache refresh when saving via admin area is handled in EM_Event_Post_Admin::save_post/refresh_cache
|
393 |
if( $post_save && $meta_save && $this->is_published() ){
|
394 |
//we won't depend on hooks, if we saved the event and it's still published in its saved state, refresh the cache regardless
|
395 |
+
$this->load_postdata($post_data);
|
396 |
wp_cache_set($this->location_id, $this, 'em_locations');
|
397 |
wp_cache_set($this->post_id, $this->location_id, 'em_locations_ids');
|
398 |
}
|
classes/em-notices.php
CHANGED
@@ -52,16 +52,16 @@
|
|
52 |
function __toString(){
|
53 |
$string = false;
|
54 |
if(count($this->notices['errors']) > 0){
|
55 |
-
$string .= "<div class='em-warning em-warning-errors error'>{$this->get_errors()}</div>";
|
56 |
}
|
57 |
if(count($this->notices['alerts']) > 0){
|
58 |
-
$string .= "<div class='em-warning em-warning-alerts
|
59 |
}
|
60 |
if(count($this->notices['infos']) > 0){
|
61 |
-
$string .= "<div class='em-warning em-warning-infos
|
62 |
}
|
63 |
if(count($this->notices['confirms']) > 0){
|
64 |
-
$string .= "<div class='em-warning em-warning-confirms
|
65 |
}
|
66 |
$this->displayed = true;
|
67 |
return ($string !== false) ? "<div class='statusnotice'>".$string."</div>" : '';
|
52 |
function __toString(){
|
53 |
$string = false;
|
54 |
if(count($this->notices['errors']) > 0){
|
55 |
+
$string .= "<div class='em-warning em-warning-errors notice notice-error'>{$this->get_errors()}</div>";
|
56 |
}
|
57 |
if(count($this->notices['alerts']) > 0){
|
58 |
+
$string .= "<div class='em-warning em-warning-alerts notice notice-warning'>{$this->get_alerts()}</div>";
|
59 |
}
|
60 |
if(count($this->notices['infos']) > 0){
|
61 |
+
$string .= "<div class='em-warning em-warning-infos notice notice-info'>{$this->get_infos()}</div>";
|
62 |
}
|
63 |
if(count($this->notices['confirms']) > 0){
|
64 |
+
$string .= "<div class='em-warning em-warning-confirms notice notice-success'>{$this->get_confirms()}</div>";
|
65 |
}
|
66 |
$this->displayed = true;
|
67 |
return ($string !== false) ? "<div class='statusnotice'>".$string."</div>" : '';
|
classes/em-tickets.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* @author marcus
|
5 |
*
|
6 |
*/
|
7 |
-
class EM_Tickets extends EM_Object implements Iterator{
|
8 |
|
9 |
/**
|
10 |
* Array of EM_Ticket objects for a specific event
|
@@ -260,5 +260,9 @@ class EM_Tickets extends EM_Object implements Iterator{
|
|
260 |
$var = ($key !== NULL && $key !== FALSE);
|
261 |
return $var;
|
262 |
}
|
|
|
|
|
|
|
|
|
263 |
}
|
264 |
?>
|
4 |
* @author marcus
|
5 |
*
|
6 |
*/
|
7 |
+
class EM_Tickets extends EM_Object implements Iterator, Countable {
|
8 |
|
9 |
/**
|
10 |
* Array of EM_Ticket objects for a specific event
|
260 |
$var = ($key !== NULL && $key !== FALSE);
|
261 |
return $var;
|
262 |
}
|
263 |
+
//Countable Implementation
|
264 |
+
public function count(){
|
265 |
+
return count($this->tickets);
|
266 |
+
}
|
267 |
}
|
268 |
?>
|
em-actions.php
CHANGED
@@ -78,6 +78,9 @@ function em_init_actions() {
|
|
78 |
if( $_REQUEST['action'] == 'event_save' && $EM_Event->can_manage('edit_events','edit_others_events') ){
|
79 |
//Check Nonces
|
80 |
if( !wp_verify_nonce($_REQUEST['_wpnonce'], 'wpnonce_event_save') ) exit('Trying to perform an illegal action.');
|
|
|
|
|
|
|
81 |
//Grab and validate submitted data
|
82 |
if ( $EM_Event->get_post() && $EM_Event->save() ) { //EM_Event gets the event if submitted via POST and validates it (safer than to depend on JS)
|
83 |
$events_result = true;
|
@@ -99,6 +102,8 @@ function em_init_actions() {
|
|
99 |
$EM_Notices->add_error( $EM_Event->get_errors() );
|
100 |
$events_result = false;
|
101 |
}
|
|
|
|
|
102 |
}
|
103 |
if ( $_REQUEST['action'] == 'event_duplicate' && wp_verify_nonce($_REQUEST['_wpnonce'],'event_duplicate_'.$EM_Event->event_id) ) {
|
104 |
$event = $EM_Event->duplicate();
|
78 |
if( $_REQUEST['action'] == 'event_save' && $EM_Event->can_manage('edit_events','edit_others_events') ){
|
79 |
//Check Nonces
|
80 |
if( !wp_verify_nonce($_REQUEST['_wpnonce'], 'wpnonce_event_save') ) exit('Trying to perform an illegal action.');
|
81 |
+
//Set server timezone to UTC in case other plugins are doing something naughty
|
82 |
+
$server_timezone = date_default_timezone_get();
|
83 |
+
date_default_timezone_set('UTC');
|
84 |
//Grab and validate submitted data
|
85 |
if ( $EM_Event->get_post() && $EM_Event->save() ) { //EM_Event gets the event if submitted via POST and validates it (safer than to depend on JS)
|
86 |
$events_result = true;
|
102 |
$EM_Notices->add_error( $EM_Event->get_errors() );
|
103 |
$events_result = false;
|
104 |
}
|
105 |
+
//Set server timezone back, even though it should be UTC anyway
|
106 |
+
date_default_timezone_set($server_timezone);
|
107 |
}
|
108 |
if ( $_REQUEST['action'] == 'event_duplicate' && wp_verify_nonce($_REQUEST['_wpnonce'],'event_duplicate_'.$EM_Event->event_id) ) {
|
109 |
$event = $EM_Event->duplicate();
|
em-posts.php
CHANGED
@@ -43,8 +43,8 @@ add_action('init','wp_events_plugin_init',1);
|
|
43 |
function wp_events_plugin_init(){
|
44 |
define('EM_ADMIN_URL',admin_url().'edit.php?post_type='.EM_POST_TYPE_EVENT); //we assume the admin url is absolute with at least one querystring
|
45 |
if( get_option('dbem_tags_enabled', true) ){
|
46 |
-
register_taxonomy(EM_TAXONOMY_TAG,array(EM_POST_TYPE_EVENT,'event-recurring'),array(
|
47 |
-
'hierarchical' => false,
|
48 |
'public' => true,
|
49 |
'show_ui' => true,
|
50 |
'query_var' => true,
|
@@ -76,12 +76,12 @@ function wp_events_plugin_init(){
|
|
76 |
'delete_terms' => 'delete_event_categories',
|
77 |
'assign_terms' => 'edit_events',
|
78 |
)
|
79 |
-
));
|
80 |
}
|
81 |
if( get_option('dbem_categories_enabled', true) ){
|
82 |
$supported_array = (EM_MS_GLOBAL && !is_main_site()) ? array():array(EM_POST_TYPE_EVENT,'event-recurring');
|
83 |
-
register_taxonomy(EM_TAXONOMY_CATEGORY,$supported_array,array(
|
84 |
-
'hierarchical' => true,
|
85 |
'public' => true,
|
86 |
'show_ui' => true,
|
87 |
'query_var' => true,
|
@@ -113,10 +113,10 @@ function wp_events_plugin_init(){
|
|
113 |
'delete_terms' => 'delete_event_categories',
|
114 |
'assign_terms' => 'edit_events',
|
115 |
)
|
116 |
-
));
|
117 |
}
|
118 |
$event_post_type_supports = apply_filters('em_cp_event_supports', array('custom-fields','title','editor','excerpt','comments','thumbnail','author'));
|
119 |
-
$event_post_type = array(
|
120 |
'public' => true,
|
121 |
'hierarchical' => false,
|
122 |
'show_ui' => true,
|
@@ -160,9 +160,9 @@ function wp_events_plugin_init(){
|
|
160 |
),
|
161 |
'menu_icon' => 'dashicons-calendar',
|
162 |
'yarpp_support'=>true
|
163 |
-
);
|
164 |
if ( get_option('dbem_recurrence_enabled') ){
|
165 |
-
$event_recurring_post_type = array(
|
166 |
'public' => apply_filters('em_cp_event_recurring_public', false),
|
167 |
'show_ui' => true,
|
168 |
'show_in_admin_bar' => true,
|
@@ -205,10 +205,10 @@ function wp_events_plugin_init(){
|
|
205 |
'not_found_in_trash' => __('No Recurring Events Found in Trash','events-manager'),
|
206 |
'parent' => __('Parent Recurring Event','events-manager'),
|
207 |
)
|
208 |
-
);
|
209 |
}
|
210 |
if( get_option('dbem_locations_enabled', true) ){
|
211 |
-
$location_post_type = array(
|
212 |
'public' => true,
|
213 |
'hierarchical' => false,
|
214 |
'show_in_admin_bar' => true,
|
@@ -254,7 +254,7 @@ function wp_events_plugin_init(){
|
|
254 |
'parent' => __('Parent Location','events-manager'),
|
255 |
),
|
256 |
'yarpp_support'=>true
|
257 |
-
);
|
258 |
}
|
259 |
//gutenberg support - define EM_GUTENBERG in your wp-config.php page to enable
|
260 |
if( defined('EM_GUTENBERG') && EM_GUTENBERG ){
|
43 |
function wp_events_plugin_init(){
|
44 |
define('EM_ADMIN_URL',admin_url().'edit.php?post_type='.EM_POST_TYPE_EVENT); //we assume the admin url is absolute with at least one querystring
|
45 |
if( get_option('dbem_tags_enabled', true) ){
|
46 |
+
register_taxonomy(EM_TAXONOMY_TAG,array(EM_POST_TYPE_EVENT,'event-recurring'), apply_filters('em_ct_tags', array(
|
47 |
+
'hierarchical' => false,
|
48 |
'public' => true,
|
49 |
'show_ui' => true,
|
50 |
'query_var' => true,
|
76 |
'delete_terms' => 'delete_event_categories',
|
77 |
'assign_terms' => 'edit_events',
|
78 |
)
|
79 |
+
)));
|
80 |
}
|
81 |
if( get_option('dbem_categories_enabled', true) ){
|
82 |
$supported_array = (EM_MS_GLOBAL && !is_main_site()) ? array():array(EM_POST_TYPE_EVENT,'event-recurring');
|
83 |
+
register_taxonomy(EM_TAXONOMY_CATEGORY,$supported_array, apply_filters('em_ct_categories', array(
|
84 |
+
'hierarchical' => true,
|
85 |
'public' => true,
|
86 |
'show_ui' => true,
|
87 |
'query_var' => true,
|
113 |
'delete_terms' => 'delete_event_categories',
|
114 |
'assign_terms' => 'edit_events',
|
115 |
)
|
116 |
+
)));
|
117 |
}
|
118 |
$event_post_type_supports = apply_filters('em_cp_event_supports', array('custom-fields','title','editor','excerpt','comments','thumbnail','author'));
|
119 |
+
$event_post_type = apply_filters('em_cpt_event', array(
|
120 |
'public' => true,
|
121 |
'hierarchical' => false,
|
122 |
'show_ui' => true,
|
160 |
),
|
161 |
'menu_icon' => 'dashicons-calendar',
|
162 |
'yarpp_support'=>true
|
163 |
+
));
|
164 |
if ( get_option('dbem_recurrence_enabled') ){
|
165 |
+
$event_recurring_post_type = apply_filters('em_cpt_event_recurring', array(
|
166 |
'public' => apply_filters('em_cp_event_recurring_public', false),
|
167 |
'show_ui' => true,
|
168 |
'show_in_admin_bar' => true,
|
205 |
'not_found_in_trash' => __('No Recurring Events Found in Trash','events-manager'),
|
206 |
'parent' => __('Parent Recurring Event','events-manager'),
|
207 |
)
|
208 |
+
));
|
209 |
}
|
210 |
if( get_option('dbem_locations_enabled', true) ){
|
211 |
+
$location_post_type = apply_filters('em_cpt_location', array(
|
212 |
'public' => true,
|
213 |
'hierarchical' => false,
|
214 |
'show_in_admin_bar' => true,
|
254 |
'parent' => __('Parent Location','events-manager'),
|
255 |
),
|
256 |
'yarpp_support'=>true
|
257 |
+
));
|
258 |
}
|
259 |
//gutenberg support - define EM_GUTENBERG in your wp-config.php page to enable
|
260 |
if( defined('EM_GUTENBERG') && EM_GUTENBERG ){
|
events-manager.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Events Manager
|
4 |
-
Version: 5.9.
|
5 |
Plugin URI: http://wp-events-plugin.com
|
6 |
Description: Event registration and booking management for WordPress. Recurring events, locations, google maps, rss, ical, booking registration and more!
|
7 |
Author: Marcus Sykes
|
@@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
28 |
*/
|
29 |
|
30 |
// Setting constants
|
31 |
-
define('EM_VERSION', 5.
|
32 |
define('EM_PRO_MIN_VERSION', 2.392); //self expanatory
|
33 |
define('EM_PRO_MIN_VERSION_CRITICAL', 2.377); //self expanatory
|
34 |
define('EM_DIR', dirname( __FILE__ )); //an absolute path to this directory
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Events Manager
|
4 |
+
Version: 5.9.2
|
5 |
Plugin URI: http://wp-events-plugin.com
|
6 |
Description: Event registration and booking management for WordPress. Recurring events, locations, google maps, rss, ical, booking registration and more!
|
7 |
Author: Marcus Sykes
|
28 |
*/
|
29 |
|
30 |
// Setting constants
|
31 |
+
define('EM_VERSION', 5.92); //self expanatory
|
32 |
define('EM_PRO_MIN_VERSION', 2.392); //self expanatory
|
33 |
define('EM_PRO_MIN_VERSION_CRITICAL', 2.377); //self expanatory
|
34 |
define('EM_DIR', dirname( __FILE__ )); //an absolute path to this directory
|
multilingual/em-ml-bookings.php
CHANGED
@@ -6,7 +6,10 @@ class EM_ML_Bookings {
|
|
6 |
add_filter('em_event_get_bookings', 'EM_ML_Bookings::override_bookings',100,2);
|
7 |
add_action('em_booking_form_footer','EM_ML_Bookings::em_booking_form_footer',10,1);
|
8 |
add_action('em_booking_output_event', 'EM_ML_Bookings::em_booking_output_event',10,2);
|
9 |
-
add_filter('em_booking_email_messages', 'EM_ML_Bookings::em_booking_email_messages',10,2);
|
|
|
|
|
|
|
10 |
}
|
11 |
|
12 |
/**
|
@@ -112,5 +115,34 @@ class EM_ML_Bookings {
|
|
112 |
}
|
113 |
return $msg;
|
114 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
}
|
116 |
EM_ML_Bookings::init();
|
6 |
add_filter('em_event_get_bookings', 'EM_ML_Bookings::override_bookings',100,2);
|
7 |
add_action('em_booking_form_footer','EM_ML_Bookings::em_booking_form_footer',10,1);
|
8 |
add_action('em_booking_output_event', 'EM_ML_Bookings::em_booking_output_event',10,2);
|
9 |
+
add_filter('em_booking_email_messages', 'EM_ML_Bookings::em_booking_email_messages',10,2);
|
10 |
+
add_action('em_bookings_admin_page', 'EM_ML_Bookings::em_bookings_admin_page',10,2);
|
11 |
+
add_filter('em_bookings_table_rows_col', 'EM_ML_Bookings::em_bookings_table_rows_col',1,6);
|
12 |
+
add_filter('em_bookings_table_cols_template', 'EM_ML_Bookings::em_bookings_table_cols_template',1,2);
|
13 |
}
|
14 |
|
15 |
/**
|
115 |
}
|
116 |
return $msg;
|
117 |
}
|
118 |
+
|
119 |
+
public static function em_bookings_admin_page(){
|
120 |
+
global $EM_Booking; /* @var EM_Notices $EM_Notices */
|
121 |
+
if( !empty($_REQUEST['booking_id']) && is_object($EM_Booking) ){
|
122 |
+
if( !empty($EM_Booking->booking_meta['lang']) && EM_ML::$wplang != $EM_Booking->booking_meta['lang'] ){
|
123 |
+
$EM_Notices = new EM_Notices(false);
|
124 |
+
require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
|
125 |
+
$languages = EM_ML::get_langs();
|
126 |
+
$lang = $EM_Booking->booking_meta['lang'];
|
127 |
+
$language = !empty($languages[$lang]) ? $languages[$lang]:$lang;
|
128 |
+
$EM_Notices->add_info(sprintf(esc_html__('The language used to make this booking was %s', 'events-manager'), $language));
|
129 |
+
echo $EM_Notices;
|
130 |
+
}
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
public static function em_bookings_table_rows_col($value, $col, $EM_Booking, $EM_Bookings_Table, $format, $object){
|
135 |
+
if( $col == 'booking_language' ){
|
136 |
+
$languages = EM_ML::get_langs();
|
137 |
+
$lang = !empty($EM_Booking->booking_meta['lang']) ? $EM_Booking->booking_meta['lang'] : EM_ML::$wplang;
|
138 |
+
$value = !empty($languages[$lang]) ? $languages[$lang]:$lang;
|
139 |
+
}
|
140 |
+
return $value;
|
141 |
+
}
|
142 |
+
|
143 |
+
public static function em_bookings_table_cols_template($template, $EM_Bookings_Table){
|
144 |
+
$template ['booking_language'] = __('Language Booked', 'events-manager');
|
145 |
+
return $template;
|
146 |
+
}
|
147 |
}
|
148 |
EM_ML_Bookings::init();
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: bookings, calendar, tickets, events, buddypress, event management, google
|
|
5 |
Text Domain: events-manager
|
6 |
Requires at least: 3.5
|
7 |
Tested up to: 4.9
|
8 |
-
Stable tag: 5.9.
|
9 |
|
10 |
Fully featured event registration management including recurring events, locations management, calendar, Google map integration, booking management
|
11 |
|
@@ -44,6 +44,7 @@ Version 5 now makes events and locations WordPress Custom Post Types, allowing f
|
|
44 |
* Add to Google Calendar buttons
|
45 |
* RSS Feeds
|
46 |
* Compatible with SEO plugins
|
|
|
47 |
* Plenty of template tags and shortcodes for use in your posts and pages
|
48 |
* Actively maintained and supported
|
49 |
* Lots of documentation and tutorials
|
@@ -99,6 +100,18 @@ See our [FAQ](http://wp-events-plugin.com/documentation/faq/) page, which is upd
|
|
99 |
6. Manage attendees with various booking reports
|
100 |
|
101 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
= 5.9.1 =
|
103 |
* fixed the & operator in category search attribute not working correctly in MultiSite Global Tables mode
|
104 |
* added fix/workaround for any code that changes the timezone from WP's UTC timezone during runtime
|
5 |
Text Domain: events-manager
|
6 |
Requires at least: 3.5
|
7 |
Tested up to: 4.9
|
8 |
+
Stable tag: 5.9.2
|
9 |
|
10 |
Fully featured event registration management including recurring events, locations management, calendar, Google map integration, booking management
|
11 |
|
44 |
* Add to Google Calendar buttons
|
45 |
* RSS Feeds
|
46 |
* Compatible with SEO plugins
|
47 |
+
* Timezone Support - create events in different timezones
|
48 |
* Plenty of template tags and shortcodes for use in your posts and pages
|
49 |
* Actively maintained and supported
|
50 |
* Lots of documentation and tutorials
|
100 |
6. Manage attendees with various booking reports
|
101 |
|
102 |
== Changelog ==
|
103 |
+
= 5.9.2 =
|
104 |
+
* fixed some instances where PHP 5.2 outputs incorrect times due to other plugins changing server timezones
|
105 |
+
* fixed scope issues with PHP 5.2 when calculating start/end of month dates
|
106 |
+
* fixed potential issues with manual offsets when other plugins change server timezones whilst saving events, particularly in PHP 5.2
|
107 |
+
* added EM_CACHE constant which if defined as false will disable caching
|
108 |
+
* fixed issues when changing times of an EM_DateTime object with large manual offset timezones may cause incorrect dates (fixes some weekly recurrence pattern issues)
|
109 |
+
* added notice when viewing bookings made in another language
|
110 |
+
* added booking admin table column for language used in booking
|
111 |
+
* fixed some minor PHP notices preventing event submissions/edits with a new location if display_errors are enabled
|
112 |
+
* updated EM_Notices to use new class names for notices output in WP Dasbhoard
|
113 |
+
* added filters for all post type and custom taxonomy arrays used in initial post type and custom taxonomy registration functions (see em-posts.php)
|
114 |
+
|
115 |
= 5.9.1 =
|
116 |
* fixed the & operator in category search attribute not working correctly in MultiSite Global Tables mode
|
117 |
* added fix/workaround for any code that changes the timezone from WP's UTC timezone during runtime
|