The Events Calendar Shortcode - Version 1.7.1

Version Description

  • Fix for month option where there's an all-day event the first day of the next month
  • Fix for "There are no events" string not being translated automatically into other languages
Download this release

Release Info

Developer brianhogg
Plugin Icon 128x128 The Events Calendar Shortcode
Version 1.7.1
Comparing to
See all releases

Code changes from version 1.7 to 1.7.1

Files changed (2) hide show
  1. readme.txt +12 -4
  2. the-events-calendar-shortcode.php +15 -8
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: brianhogg
3
  Tags: event, events, calendar, shortcode, modern tribe
4
  Requires at least: 4.1
5
- Tested up to: 4.8
6
- Stable tag: 1.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -40,7 +40,7 @@ With this plugin, just add the shortcode on a page to display a list of your eve
40
  <blockquote>
41
  <h4>Additional options and benefits in the pro version</h4>
42
  <ul>
43
- <li>design - Shows <a href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode#designs?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-design&utm_content=description" target="_blank">improved design by default</a>, 'compact' for a more compact listing, 'calendar' for a monthly calendar view, or 'grouped' to group events by day</li>
44
  <li>days - Specify how many days in the future, for example [ecs-list-events days="1"] for one day or [ecs-list-events days="7"] for one week</li>
45
  <li>date - Show only events for a specific day [ecs-list-events date='2017-04-16']</li>
46
  <li>tag - Filter by one or more tags. Use commas when you want to filter by multiple tags.</li>
@@ -98,7 +98,7 @@ You can then add the `[ecs-list-events]` shortcode to the page or post you want
98
 
99
  With [The Events Calendar Shortcode PRO](https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-faq-options&utm_content=description) you also get the following options:
100
 
101
- * design - Shows improved design by default. Set to 'standard' for the regular one, 'compact' for a more compact listing, 'calendar' for a monthly calendar view, or 'grouped' to group events by day
102
  * days - Specify how many days in the future, for example `[ecs-list-events days="1"]` for one day or `[ecs-list-events days="7"]` for one week
103
  * tag - Filter by one or more tags. Use commas when you want to filter by multiple tags.
104
  * id - Show a single event, useful for displaying details of the event on a blog post or page
@@ -155,6 +155,10 @@ The [pro version of the plugin](https://eventcalendarnewsletter.com/the-events-c
155
 
156
  == Upgrade Notice ==
157
 
 
 
 
 
158
  = 1.7 =
159
  * Adds structured data to the shortcode output (great for SEO and people finding your events)
160
 
@@ -227,6 +231,10 @@ Fix missing ul
227
 
228
  == Changelog ==
229
 
 
 
 
 
230
  = 1.7 =
231
  * Adds structured data to the shortcode output (great for SEO and people finding your events)
232
 
2
  Contributors: brianhogg
3
  Tags: event, events, calendar, shortcode, modern tribe
4
  Requires at least: 4.1
5
+ Tested up to: 4.9
6
+ Stable tag: 1.7.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
40
  <blockquote>
41
  <h4>Additional options and benefits in the pro version</h4>
42
  <ul>
43
+ <li>design - Shows <a href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode/?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-design&utm_content=description#designs" target="_blank">improved design by default</a>, 'compact' for a more compact listing, 'calendar' for a monthly calendar view, 'columns' to show events horizontally in columns, or 'grouped' to group events by day</li>
44
  <li>days - Specify how many days in the future, for example [ecs-list-events days="1"] for one day or [ecs-list-events days="7"] for one week</li>
45
  <li>date - Show only events for a specific day [ecs-list-events date='2017-04-16']</li>
46
  <li>tag - Filter by one or more tags. Use commas when you want to filter by multiple tags.</li>
98
 
99
  With [The Events Calendar Shortcode PRO](https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-faq-options&utm_content=description) you also get the following options:
100
 
101
+ * design - Shows improved design by default. Set to 'standard' for the regular one, 'compact' for a more compact listing, 'calendar' for a monthly calendar view, 'columns' to show a horizontal/columns/photo view, or 'grouped' to group events by day
102
  * days - Specify how many days in the future, for example `[ecs-list-events days="1"]` for one day or `[ecs-list-events days="7"]` for one week
103
  * tag - Filter by one or more tags. Use commas when you want to filter by multiple tags.
104
  * id - Show a single event, useful for displaying details of the event on a blog post or page
155
 
156
  == Upgrade Notice ==
157
 
158
+ = 1.7.1 =
159
+ * Fix for month option where there's an all-day event the first day of the next month
160
+ * Fix for "There are no events" string not being translated automatically into other languages
161
+
162
  = 1.7 =
163
  * Adds structured data to the shortcode output (great for SEO and people finding your events)
164
 
231
 
232
  == Changelog ==
233
 
234
+ = 1.7.1 =
235
+ * Fix for month option where there's an all-day event the first day of the next month
236
+ * Fix for "There are no events" string not being translated automatically into other languages
237
+
238
  = 1.7 =
239
  * Adds structured data to the shortcode output (great for SEO and people finding your events)
240
 
the-events-calendar-shortcode.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: The Events Calendar Shortcode
4
  Plugin URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode/
5
  Description: An addon to add shortcode functionality for <a href="http://wordpress.org/plugins/the-events-calendar/">The Events Calendar Plugin by Modern Tribe</a>.
6
- Version: 1.7
7
  Author: Event Calendar Newsletter
8
  Author URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode
9
  Contributors: brianhogg
@@ -38,7 +38,7 @@ class Events_Calendar_Shortcode
38
  *
39
  * @since 1.0.0
40
  */
41
- const VERSION = '1.7';
42
 
43
  private $admin_page = null;
44
 
@@ -149,7 +149,7 @@ class Events_Calendar_Shortcode
149
  'past' => null,
150
  'venue' => 'false',
151
  'author' => null,
152
- 'message' => 'There are no upcoming events at this time.',
153
  'key' => 'End Date',
154
  'order' => 'ASC',
155
  'orderby' => 'startdate',
@@ -238,10 +238,17 @@ class Events_Calendar_Shortcode
238
  $month_enddate = date( "Y-m-01", strtotime( "+1 month", strtotime( $month_startdate ) ) );
239
 
240
  $atts['meta_date'] = array(
 
241
  array(
242
  'key' => $atts['key'],
243
- 'value' => array($month_startdate, $month_enddate),
244
- 'compare' => 'BETWEEN',
 
 
 
 
 
 
245
  'type' => 'DATETIME'
246
  )
247
  );
@@ -264,7 +271,7 @@ class Events_Calendar_Shortcode
264
  $output .= apply_filters( 'ecs_start_tag', '<ul class="ecs-event-list">', $atts );
265
  $atts['contentorder'] = explode( ',', $atts['contentorder'] );
266
 
267
- foreach( (array) $posts as $post ) {
268
  setup_postdata( $post );
269
  $event_output = '';
270
  $category_slugs = array();
@@ -339,7 +346,7 @@ class Events_Calendar_Shortcode
339
  }
340
  }
341
  $event_output .= apply_filters( 'ecs_event_end_tag', '</li>', $atts, $post );
342
- $output .= apply_filters( 'ecs_single_event_output', $event_output, $atts, $post );
343
  }
344
  $output .= apply_filters( 'ecs_end_tag', '</ul>', $atts );
345
  $output = apply_filters( 'ecs_ending_output', $output, $posts, $atts );
@@ -351,7 +358,7 @@ class Events_Calendar_Shortcode
351
  }
352
 
353
  } else { //No Events were Found
354
- $output .= apply_filters( 'ecs_no_events_found_message', translate( $atts['message'], 'tribe-events-calendar' ), $atts );
355
  } // endif
356
 
357
  wp_reset_query();
3
  Plugin Name: The Events Calendar Shortcode
4
  Plugin URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode/
5
  Description: An addon to add shortcode functionality for <a href="http://wordpress.org/plugins/the-events-calendar/">The Events Calendar Plugin by Modern Tribe</a>.
6
+ Version: 1.7.1
7
  Author: Event Calendar Newsletter
8
  Author URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode
9
  Contributors: brianhogg
38
  *
39
  * @since 1.0.0
40
  */
41
+ const VERSION = '1.7.1';
42
 
43
  private $admin_page = null;
44
 
149
  'past' => null,
150
  'venue' => 'false',
151
  'author' => null,
152
+ 'message' => 'There are no upcoming %s at this time.',
153
  'key' => 'End Date',
154
  'order' => 'ASC',
155
  'orderby' => 'startdate',
238
  $month_enddate = date( "Y-m-01", strtotime( "+1 month", strtotime( $month_startdate ) ) );
239
 
240
  $atts['meta_date'] = array(
241
+ 'relation' => 'AND',
242
  array(
243
  'key' => $atts['key'],
244
+ 'value' => $month_startdate,
245
+ 'compare' => '>=',
246
+ 'type' => 'DATETIME'
247
+ ),
248
+ array(
249
+ 'key' => $atts['key'],
250
+ 'value' => $month_enddate,
251
+ 'compare' => '<',
252
  'type' => 'DATETIME'
253
  )
254
  );
271
  $output .= apply_filters( 'ecs_start_tag', '<ul class="ecs-event-list">', $atts );
272
  $atts['contentorder'] = explode( ',', $atts['contentorder'] );
273
 
274
+ foreach( (array) $posts as $post_index => $post ) {
275
  setup_postdata( $post );
276
  $event_output = '';
277
  $category_slugs = array();
346
  }
347
  }
348
  $event_output .= apply_filters( 'ecs_event_end_tag', '</li>', $atts, $post );
349
+ $output .= apply_filters( 'ecs_single_event_output', $event_output, $atts, $post, $post_index, $posts );
350
  }
351
  $output .= apply_filters( 'ecs_end_tag', '</ul>', $atts );
352
  $output = apply_filters( 'ecs_ending_output', $output, $posts, $atts );
358
  }
359
 
360
  } else { //No Events were Found
361
+ $output .= apply_filters( 'ecs_no_events_found_message', sprintf( translate( $atts['message'], 'the-events-calendar' ), tribe_get_event_label_plural_lowercase() ), $atts );
362
  } // endif
363
 
364
  wp_reset_query();