Event Calendar WD – Responsive Event Calendar plugin - Version 1.0.5

Version Description

New: Events Filters in backend Fixed: Bug in shortcode

Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Event Calendar WD – Responsive Event Calendar plugin
Version 1.0.5
Comparing to
See all releases

Code changes from version 1.0.4 to 1.0.5

ecwd.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Event Calendar WD
4
  * Plugin URI: https://web-dorado.com/products/wordpress-event-calendar-wd.html
5
  * Description: Event Calendar WD is an easy event management and planning tool with advanced features.
6
- * Version: 1.0.4
7
  * Author: WebDorado
8
  * Author URI: http://web-dorado.com
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
3
  * Plugin Name: Event Calendar WD
4
  * Plugin URI: https://web-dorado.com/products/wordpress-event-calendar-wd.html
5
  * Description: Event Calendar WD is an easy event management and planning tool with advanced features.
6
+ * Version: 1.0.5
7
  * Author: WebDorado
8
  * Author URI: http://web-dorado.com
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
ecwd_admin_class.php CHANGED
@@ -6,7 +6,7 @@
6
  class ECWD_Admin {
7
 
8
  protected static $instance = null;
9
- protected $version = '1.0.4';
10
  protected $ecwd_page = null;
11
 
12
  private function __construct() {
6
  class ECWD_Admin {
7
 
8
  protected static $instance = null;
9
+ protected $version = '1.0.5';
10
  protected $ecwd_page = null;
11
 
12
  private function __construct() {
ecwd_class.php CHANGED
@@ -7,7 +7,7 @@
7
 
8
  class ECWD {
9
 
10
- protected $version = '1.0.4';
11
  protected $plugin_name = 'event-calendar-wd';
12
  protected $prefix = 'ecwd';
13
  protected $old_version = '1.4.11';
7
 
8
  class ECWD {
9
 
10
+ protected $version = '1.0.5';
11
  protected $plugin_name = 'event-calendar-wd';
12
  protected $prefix = 'ecwd';
13
  protected $old_version = '1.4.11';
includes/ecwd-cpt-class.php CHANGED
@@ -81,6 +81,9 @@ class ECWD_Cpt {
81
  add_filter( 'manage_' . ECWD_PLUGIN_PREFIX . '_event_posts_columns', array( $this, 'add_column_headers' ) );
82
 
83
  add_filter( 'template_include', array($this, 'ecwd_templates') );
 
 
 
84
  }
85
 
86
 
@@ -1055,7 +1058,7 @@ class ECWD_Cpt {
1055
 
1056
  $new_columns = array(
1057
  'cb' => $defaults['cb'],
1058
- 'event-id' => __( 'Event ID', 'ecwd' )
1059
  );
1060
 
1061
  return array_merge( $defaults, $new_columns );
@@ -1084,7 +1087,14 @@ class ECWD_Cpt {
1084
  public function event_column_content( $column_name, $post_ID ) {
1085
  switch ( $column_name ) {
1086
  case 'event-id':
1087
- echo $post_ID;
 
 
 
 
 
 
 
1088
  break;
1089
  }
1090
  }
@@ -1234,7 +1244,20 @@ class ECWD_Cpt {
1234
  return $columns;
1235
  }
1236
 
1237
-
 
 
 
 
 
 
 
 
 
 
 
 
 
1238
  public function get_ecwd_calendars() {
1239
  $args = array(
1240
  'numberposts' => - 1,
81
  add_filter( 'manage_' . ECWD_PLUGIN_PREFIX . '_event_posts_columns', array( $this, 'add_column_headers' ) );
82
 
83
  add_filter( 'template_include', array($this, 'ecwd_templates') );
84
+
85
+ //category filter
86
+ add_filter('init',array($this, 'event_restrict_manage'));
87
  }
88
 
89
 
1058
 
1059
  $new_columns = array(
1060
  'cb' => $defaults['cb'],
1061
+ 'event-id' => __( 'Event Dates', 'ecwd' )
1062
  );
1063
 
1064
  return array_merge( $defaults, $new_columns );
1087
  public function event_column_content( $column_name, $post_ID ) {
1088
  switch ( $column_name ) {
1089
  case 'event-id':
1090
+ $start = get_post_meta($post_ID, ECWD_PLUGIN_PREFIX . '_event_date_from', true);
1091
+ $end = get_post_meta($post_ID, ECWD_PLUGIN_PREFIX . '_event_date_to', true);
1092
+ if($start) {
1093
+ echo date( 'Y/m/d', strtotime( $start ) );
1094
+ echo ' - ' . date( 'Y/m/d', strtotime( $end ) );
1095
+ }else{
1096
+ echo 'No dates';
1097
+ }
1098
  break;
1099
  }
1100
  }
1244
  return $columns;
1245
  }
1246
 
1247
+ public function event_restrict_manage() {
1248
+ include_once 'ecwd-cpt-filter.php';
1249
+ new Tax_CTP_Filter(
1250
+ array(
1251
+ self::EVENT_POST_TYPE => array(
1252
+ ECWD_PLUGIN_PREFIX . '_calendar',
1253
+ ECWD_PLUGIN_PREFIX . '_event_category',
1254
+ ECWD_PLUGIN_PREFIX . '_organizer',
1255
+ ECWD_PLUGIN_PREFIX . '_venue',
1256
+ ECWD_PLUGIN_PREFIX . '_event_tag'
1257
+ )
1258
+ )
1259
+ );
1260
+ }
1261
  public function get_ecwd_calendars() {
1262
  $args = array(
1263
  'numberposts' => - 1,
includes/ecwd-cpt-filter.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!class_exists('Tax_CTP_Filter')) {
4
+
5
+ class Tax_CTP_Filter {
6
+
7
+ function __construct($cpt = array()) {
8
+ $this->cpt = $cpt;
9
+ add_action('restrict_manage_posts', array($this, 'event_restrict_manage_posts'));
10
+ add_filter('parse_query', array($this, 'event_table_filter'));
11
+ add_filter('admin_head',array($this,'hide_month_filter'));
12
+ }
13
+
14
+ public function hide_month_filter() {
15
+ global $typenow;
16
+ $types = array_keys($this->cpt);
17
+ if (in_array($typenow, $types)) {
18
+ add_filter('months_dropdown_results','__return_empty_array');
19
+ }
20
+ }
21
+
22
+ public function event_restrict_manage_posts() {
23
+ global $typenow;
24
+ $types = array_keys($this->cpt);
25
+ if (in_array($typenow, $types)) {
26
+ $filters = $this->cpt[$typenow];
27
+ foreach ($filters as $tax_slug) {
28
+ if($tax_slug==ECWD_PLUGIN_PREFIX . '_event_category' || $tax_slug==ECWD_PLUGIN_PREFIX . '_event_tag'){
29
+
30
+ $tax_obj = get_taxonomy($tax_slug);
31
+ $tax_name = $tax_obj->labels->name;
32
+ echo "<select name='" . strtolower($tax_slug) . "' id='" . strtolower($tax_slug) . "' class='postform'>";
33
+ echo "<option value=''>All $tax_name</option>";
34
+ $this->generate_taxonomy_options($tax_slug, 0, 0, (isset($_GET[strtolower($tax_slug)])) ? $_GET[strtolower($tax_slug)] : null);
35
+
36
+ } else {
37
+
38
+ switch ($tax_slug) {
39
+ case ECWD_PLUGIN_PREFIX . '_calendar':
40
+ $tax_name = "Calendars";
41
+ break;
42
+ case ECWD_PLUGIN_PREFIX . '_organizer':
43
+ $tax_name = "Organizers";
44
+ break;
45
+ case ECWD_PLUGIN_PREFIX . '_venue':
46
+ $tax_name = "Venues";
47
+ break;
48
+
49
+ default :
50
+ break;
51
+ }
52
+ $tax_obj = get_posts(array(
53
+ 'post_type' => $tax_slug,
54
+ 'showposts' => -1,
55
+ 'order' => 'ASC'
56
+ ));
57
+ $selected = isset($_GET[strtolower($tax_slug). '_filter']) ? $_GET[strtolower($tax_slug). '_filter'] : null;
58
+ echo "<select name='" . strtolower($tax_slug) . "_filter' id='" . strtolower($tax_slug) . "_filter' class='postform'>";
59
+ echo "<option value=''>All $tax_name</option>";
60
+ foreach ($tax_obj as $term) {
61
+ echo '<option value=' . $term->ID, $selected == $term->ID ? ' selected="selected"' : '', '>' . $term->post_title . '</option>';
62
+ }
63
+ }
64
+ echo "</select>";
65
+ }
66
+ echo "<div style='display:inline-block;'>";
67
+ _e('From', 'ecwd');?>
68
+ <input type="text" style="width: 90px"
69
+ id="<?php echo ECWD_PLUGIN_PREFIX; ?>_date_from_filter"
70
+ name="<?php echo ECWD_PLUGIN_PREFIX; ?>_date_from_filter"
71
+ class="<?php echo ECWD_PLUGIN_PREFIX; ?>_event_date"
72
+ value="<?php echo isset($_GET[ECWD_PLUGIN_PREFIX.'_date_from_filter'])? $_GET[ECWD_PLUGIN_PREFIX.'_date_from_filter']: ''; ?>" />
73
+ <?php
74
+ _e('To', 'ecwd');?>
75
+ <input type="text" style="width: 90px"
76
+ id="<?php echo ECWD_PLUGIN_PREFIX; ?>_date_to_filter"
77
+ name="<?php echo ECWD_PLUGIN_PREFIX; ?>_date_to_filter"
78
+ class="<?php echo ECWD_PLUGIN_PREFIX; ?>_event_date"
79
+ value="<?php echo isset($_GET[ECWD_PLUGIN_PREFIX.'_date_to_filter'])? $_GET[ECWD_PLUGIN_PREFIX.'_date_to_filter']: ''; ?>" />
80
+ </div>
81
+ <a href="<?php echo admin_url( 'edit.php?post_type=ecwd_event' );?>" class="button" >Reset</a>
82
+ <?php
83
+ }
84
+ }
85
+
86
+ public function generate_taxonomy_options($tax_slug, $parent = '', $level = 0, $selected = null) {
87
+ $args = array();
88
+ if (!is_null($parent)) {
89
+ $args = array('parent' => $parent);
90
+ }
91
+ $args['hide_empty'] = false;
92
+ $terms = get_terms($tax_slug, $args);
93
+ $tab = '';
94
+ for ($i = 0; $i < $level; $i++) {
95
+ $tab.='--';
96
+ }
97
+ foreach ($terms as $term) {
98
+ echo '<option value=' . $term->slug, $selected == $term->slug ? ' selected="selected"' : '', '>' . $tab . $term->name . '</option>';
99
+ $this->generate_taxonomy_options($tax_slug, $term->term_id, $level + 1, $selected);
100
+ }
101
+ }
102
+
103
+ public function event_table_filter($query) {
104
+ $types = array_keys($this->cpt);
105
+ if (is_admin() AND in_array($query->query['post_type'], $types)) {
106
+ $qv = &$query->query_vars;
107
+ $qv['meta_query'] = array();
108
+
109
+ if (!empty($_GET[ECWD_PLUGIN_PREFIX . '_calendar_filter'])) {
110
+ $qv['meta_query'][] = array(
111
+ 'key' => ECWD_PLUGIN_PREFIX . '_event_calendars',
112
+ 'value' => serialize( strval( $_GET[ECWD_PLUGIN_PREFIX . '_calendar_filter'] ) ),
113
+ 'compare' => 'LIKE'
114
+ );
115
+ }
116
+ if (!empty($_GET[ECWD_PLUGIN_PREFIX . '_organizer_filter'])) {
117
+ $qv['meta_query'][] = array(
118
+ 'key' => ECWD_PLUGIN_PREFIX . '_event_organizers',
119
+ 'value' => serialize( strval( $_GET[ECWD_PLUGIN_PREFIX . '_organizer_filter'] ) ),
120
+ 'compare' => 'LIKE'
121
+ );
122
+ }
123
+ if (!empty($_GET[ECWD_PLUGIN_PREFIX.'_date_from_filter'])) {
124
+ $qv['meta_query'][] = array(
125
+ 'key' => ECWD_PLUGIN_PREFIX . '_event_date_to',
126
+ 'value' => $_GET[ECWD_PLUGIN_PREFIX.'_date_from_filter'],
127
+ 'compare' => '>=',
128
+ 'type' => 'DATE'
129
+ );
130
+ }
131
+ if (!empty($_GET[ECWD_PLUGIN_PREFIX.'_date_to_filter'])) {
132
+ $qv['meta_query'][] = array(
133
+ 'key' => ECWD_PLUGIN_PREFIX . '_event_date_from',
134
+ 'value' => $_GET[ECWD_PLUGIN_PREFIX.'_date_to_filter'],
135
+ 'compare' => '<=',
136
+ 'type' => 'DATE'
137
+ );
138
+ }
139
+ if (!empty($_GET[ECWD_PLUGIN_PREFIX . '_venue_filter'])) {
140
+ $qv['meta_query'][] = array(
141
+ 'key' => ECWD_PLUGIN_PREFIX . '_event_venue',
142
+ 'value' => $_GET[ECWD_PLUGIN_PREFIX . '_venue_filter'],
143
+ 'compare' => '='
144
+ );
145
+ }
146
+
147
+ }
148
+ }
149
+
150
+ }
151
+
152
+ }
js/admin/datepicker.js CHANGED
@@ -1,9 +1,10 @@
1
  (function ($) {
2
 
3
- $('#ecwd_event_repeat_until_input').datetimepicker({
4
  scrollMonth: false,
5
  scrollInput: false,
6
  timepicker:false,
 
7
  format:'Y/m/d'
8
  });
9
 
@@ -16,7 +17,7 @@
16
  var dateFromGlobal, dateToGlobal;
17
  dateFromGlobal = $("#ecwd_event_date_from").val(),
18
  dateToGlobal = $("#ecwd_event_date_to").val();
19
- if ($('.ecwd_all_day_event').prop('checked') === true) {
20
  $("#ecwd_event_date_from, #ecwd_event_date_to").datetimepicker({
21
  timepicker:false,
22
  format:'Y/m/d',
1
  (function ($) {
2
 
3
+ $('#ecwd_event_repeat_until_input, #ecwd_date_from_filter, #ecwd_date_to_filter').datetimepicker({
4
  scrollMonth: false,
5
  scrollInput: false,
6
  timepicker:false,
7
+ closeOnDateSelect:true,
8
  format:'Y/m/d'
9
  });
10
 
17
  var dateFromGlobal, dateToGlobal;
18
  dateFromGlobal = $("#ecwd_event_date_from").val(),
19
  dateToGlobal = $("#ecwd_event_date_to").val();
20
+ if ($('#ecwd_all_day_event').prop('checked') === true) {
21
  $("#ecwd_event_date_from, #ecwd_event_date_to").datetimepicker({
22
  timepicker:false,
23
  format:'Y/m/d',
js/admin/editor-buttons.js CHANGED
@@ -175,8 +175,9 @@
175
  if (v.event_search && v.event_search == 'no')
176
  event_search = false;
177
  var id = 0;
 
 
178
  var calendars = '';
179
- console.log(ecwd_plugin.ecwd_calendars.length);
180
  if (ecwd_plugin.ecwd_calendars.length !== 0) {
181
  if(id==0) {
182
  id = ecwd_plugin.ecwd_calendars[0]['value'];
175
  if (v.event_search && v.event_search == 'no')
176
  event_search = false;
177
  var id = 0;
178
+ if (v.id)
179
+ id = v.id;
180
  var calendars = '';
 
181
  if (ecwd_plugin.ecwd_calendars.length !== 0) {
182
  if(id==0) {
183
  id = ecwd_plugin.ecwd_calendars[0]['value'];
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-event-calendar-wd.html
4
  Tags: calendar, calendars, event, event calendar, event manager, events calendar, calendar widget, event registration, event management,events, agenda, holiday calendar , scheduling, free calendar, Calender, upcoming events , event widget , event list, calendar localization, Organizer, editorial calendar, Interactive Calendar, news calendar, meeting , appointment, event tracking, event organizer, upcoming events widget, event page, event bookings, recurring, recurring events, conference, date, dates, schedule, times, venue, AJAX, responsive, shortcode, seminar, summit
5
  Requires at least: 3.9
6
  Tested up to: 4.2
7
- Stable tag: 1.0.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -111,6 +111,10 @@ After downloading the ZIP file of the Event Calendar WD plugin,
111
 
112
  == Changelog ==
113
 
 
 
 
 
114
  = 1.0.4 =
115
  Fixed: Bug in add/edit calendar
116
 
4
  Tags: calendar, calendars, event, event calendar, event manager, events calendar, calendar widget, event registration, event management,events, agenda, holiday calendar , scheduling, free calendar, Calender, upcoming events , event widget , event list, calendar localization, Organizer, editorial calendar, Interactive Calendar, news calendar, meeting , appointment, event tracking, event organizer, upcoming events widget, event page, event bookings, recurring, recurring events, conference, date, dates, schedule, times, venue, AJAX, responsive, shortcode, seminar, summit
5
  Requires at least: 3.9
6
  Tested up to: 4.2
7
+ Stable tag: 1.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
111
 
112
  == Changelog ==
113
 
114
+ = 1.0.5 =
115
+ New: Events Filters in backend
116
+ Fixed: Bug in shortcode
117
+
118
  = 1.0.4 =
119
  Fixed: Bug in add/edit calendar
120
 
views/admin/ecwd-event-meta.php CHANGED
@@ -120,7 +120,7 @@ $ecwd_event_video = get_post_meta($post->ID, ECWD_PLUGIN_PREFIX . '_event_video'
120
  <th scope="row"><?php _e('Show map in event page', 'ecwd'); ?></th>
121
  <td>
122
  <div class="checkbox-div">
123
- <input type='checkbox' class='ecwd_all_day_event' id='ecwd_event_show_map'
124
  name='ecwd_event_show_map' value="1" <?php checked($ecwd_event_show_map, '1'); ?>/>
125
  <label for="ecwd_event_show_map"></label>
126
  </div>
120
  <th scope="row"><?php _e('Show map in event page', 'ecwd'); ?></th>
121
  <td>
122
  <div class="checkbox-div">
123
+ <input type='checkbox' class='ecwd_event_show_map' id='ecwd_event_show_map'
124
  name='ecwd_event_show_map' value="1" <?php checked($ecwd_event_show_map, '1'); ?>/>
125
  <label for="ecwd_event_show_map"></label>
126
  </div>