The Events Calendar Shortcode - Version 2.5

Version Description

  • Adding div when there are no events found, to avoid display issues on some themes
Download this release

Release Info

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

Code changes from version 2.4 to 2.5

Files changed (2) hide show
  1. readme.txt +15 -7
  2. the-events-calendar-shortcode.php +6 -4
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: brianhogg
3
  Tags: event, events, calendar, shortcode, modern tribe
4
  Requires at least: 4.1
5
  Requires PHP: 5.3
6
- Tested up to: 5.4
7
- Stable tag: 2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -71,6 +71,8 @@ Plus, get advanced control over how your events display:
71
  <li><strong>Full event description:</strong> Show the full event description, instead of just a short excerpt.</li>
72
  <li><strong>Only show start time:</strong> Just show the start time of your event.</li>
73
  <li><strong>Hide recurring events:</strong> Only show the first instance of a recurring event.</li>
 
 
74
  <li><strong>Custom design:</strong> Create your own templates, or use one of the seven built-in options.</li>
75
  <li><strong>Plus much more:</strong> <a href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme&utm_content=description">check out The Events Calendar Shortcode Pro details here</a>.</li>
76
  </ul>
@@ -94,7 +96,7 @@ You can then add The Events Calendar Block or `[ecs-list-events]` shortcode to t
94
 
95
  = What are the shortcode and block options for customizing my events? =
96
 
97
- Here’s the full list of shortcode and block options you can use to customize how your events display:
98
 
99
  * Basic shortcode: `[ecs-list-events]`
100
  * cat - Show events from an event category `[ecs-list-events cat='festival']` or specify multiple categories `[ecs-list-events cat='festival, workshops']`
@@ -110,7 +112,7 @@ Here’s the full list of shortcode and block options you can use to customize h
110
  * message - Message to show when there are no events. Defaults to 'There are no upcoming events at this time.'
111
  * viewall - Determines whether to show 'View all events' or not. Values can be 'true' or 'false'. Default to 'true' `[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false']`
112
  * contentorder - Manage the order of content with commas. Default to `title, thumbnail, excerpt, date, venue`. `[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false' contentorder='title, thumbnail, excerpt, date, venue']`
113
- * month - Show only specific month (in YYYY-MM format). Type `'current'` for displaying current month only or `'next'` for next month. `[ecs-list-events cat='festival' month='2015-06']`
114
  * past - Show Outdated Events. `[ecs-list-events cat='festival' past='yes']`
115
  * key - Hide events when the start date has passed `[ecs-list-events cat='festival' key='start date']`
116
  * orderby - Change the ordering to the end date `[ecs-list-events orderby="enddate"]`
@@ -126,9 +128,9 @@ With [The Events Calendar Shortcode PRO](https://eventcalendarnewsletter.com/the
126
  * raw_description - Avoid filtering any HTML (spacing, links, bullet points, etc) in the description
127
  * raw_excerpt - Avoid filtering any HTML (spacing, links, etc) in the excerpt
128
  * featured only - Show only events marked as "featured"
129
- * date - Show only events for a specific day `[ecs-list-events date='2017-04-16']`
130
- * year - Show only events for a specific year `[ecs-list-events year='2017']`
131
- * date range - Show only events between certain days `[ecs-list-events fromdate='2017-05-31' todate='2017-06-15']`
132
  * timeonly - To show just the start time of the event. `[ecs-list-events timeonly='true']`
133
  * offset - Skip a certain number of events from the beginning, useful for using multiple shortcodes on the same page (with ads in between) or splitting into columns
134
  * custom design - Create one or more of your own templates for use with the shortcode
@@ -178,6 +180,9 @@ The [pro version of the plugin](https://eventcalendarnewsletter.com/the-events-c
178
 
179
  == Upgrade Notice ==
180
 
 
 
 
181
  = 2.4 =
182
  * Updating block script dependencies
183
 
@@ -186,6 +191,9 @@ Adds link to full documentation
186
 
187
  == Changelog ==
188
 
 
 
 
189
  = 2.4 =
190
  * Updating block script dependencies
191
 
3
  Tags: event, events, calendar, shortcode, modern tribe
4
  Requires at least: 4.1
5
  Requires PHP: 5.3
6
+ Tested up to: 5.8
7
+ Stable tag: 2.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
71
  <li><strong>Full event description:</strong> Show the full event description, instead of just a short excerpt.</li>
72
  <li><strong>Only show start time:</strong> Just show the start time of your event.</li>
73
  <li><strong>Hide recurring events:</strong> Only show the first instance of a recurring event.</li>
74
+ <li><strong>Filter bar:</strong> Allow visitors to choose what events they want to see.</li>
75
+ <li><strong>Pagination:</strong> Let visitors show additional pages of events.</li>
76
  <li><strong>Custom design:</strong> Create your own templates, or use one of the seven built-in options.</li>
77
  <li><strong>Plus much more:</strong> <a href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme&utm_content=description">check out The Events Calendar Shortcode Pro details here</a>.</li>
78
  </ul>
96
 
97
  = What are the shortcode and block options for customizing my events? =
98
 
99
+ Here’s the [full list of shortcode and block options](https://eventcalendarnewsletter.com/events-calendar-shortcode-pro-options/?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-faq-options&utm_content=description) you can use to customize how your events display:
100
 
101
  * Basic shortcode: `[ecs-list-events]`
102
  * cat - Show events from an event category `[ecs-list-events cat='festival']` or specify multiple categories `[ecs-list-events cat='festival, workshops']`
112
  * message - Message to show when there are no events. Defaults to 'There are no upcoming events at this time.'
113
  * viewall - Determines whether to show 'View all events' or not. Values can be 'true' or 'false'. Default to 'true' `[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false']`
114
  * contentorder - Manage the order of content with commas. Default to `title, thumbnail, excerpt, date, venue`. `[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false' contentorder='title, thumbnail, excerpt, date, venue']`
115
+ * month - Show only specific month (in YYYY-MM format). Type `'current'` for displaying current month only or `'next'` for next month. `[ecs-list-events cat='festival' month='2021-06']`
116
  * past - Show Outdated Events. `[ecs-list-events cat='festival' past='yes']`
117
  * key - Hide events when the start date has passed `[ecs-list-events cat='festival' key='start date']`
118
  * orderby - Change the ordering to the end date `[ecs-list-events orderby="enddate"]`
128
  * raw_description - Avoid filtering any HTML (spacing, links, bullet points, etc) in the description
129
  * raw_excerpt - Avoid filtering any HTML (spacing, links, etc) in the excerpt
130
  * featured only - Show only events marked as "featured"
131
+ * date - Show only events for a specific day `[ecs-list-events date='2022-04-16']`
132
+ * year - Show only events for a specific year `[ecs-list-events year='2021']`
133
+ * date range - Show only events between certain days `[ecs-list-events fromdate='2021-05-31' todate='2021-06-15']`
134
  * timeonly - To show just the start time of the event. `[ecs-list-events timeonly='true']`
135
  * offset - Skip a certain number of events from the beginning, useful for using multiple shortcodes on the same page (with ads in between) or splitting into columns
136
  * custom design - Create one or more of your own templates for use with the shortcode
180
 
181
  == Upgrade Notice ==
182
 
183
+ = 2.5 =
184
+ * Adding div when there are no events found, to avoid display issues on some themes
185
+
186
  = 2.4 =
187
  * Updating block script dependencies
188
 
191
 
192
  == Changelog ==
193
 
194
+ = 2.5 =
195
+ * Adding div when there are no events found, to avoid display issues on some themes
196
+
197
  = 2.4 =
198
  * Updating block script dependencies
199
 
the-events-calendar-shortcode.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: The Events Calendar Shortcode & Block
4
  Plugin URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode/
5
  Description: An addon to add shortcode and new editor block functionality for The Events Calendar Plugin by Modern Tribe.
6
- Version: 2.4
7
  Author: Event Calendar Newsletter
8
  Author URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode
9
  Contributors: brianhogg
@@ -154,7 +154,7 @@ class Events_Calendar_Shortcode
154
  return '';
155
  }
156
 
157
- global $post;
158
  $output = '';
159
 
160
  $atts = shortcode_atts( apply_filters( 'ecs_shortcode_atts', array(
@@ -294,7 +294,8 @@ class Events_Calendar_Shortcode
294
  $posts = tribe_get_events( $args );
295
  $posts = apply_filters( 'ecs_filter_events_after_get', $posts, $atts );
296
 
297
- if ( $posts or apply_filters( 'ecs_always_show', false, $atts ) ) {
 
298
  $output = apply_filters( 'ecs_beginning_output', $output, $posts, $atts );
299
  $output .= apply_filters( 'ecs_start_tag', '<ul class="ecs-event-list">', $atts, count( (array) $posts ) );
300
  $atts['contentorder'] = explode( ',', $atts['contentorder'] );
@@ -304,6 +305,7 @@ class Events_Calendar_Shortcode
304
  $event_output = '';
305
  if ( apply_filters( 'ecs_skip_event', false, $atts, $post ) )
306
  continue;
 
307
  $category_slugs = array();
308
  $category_list = get_the_terms( $post, 'tribe_events_cat' );
309
  $featured_class = ( get_post_meta( get_the_ID(), '_tribe_featured', true ) ? ' ecs-featured-event' : '' );
@@ -388,7 +390,7 @@ class Events_Calendar_Shortcode
388
  }
389
 
390
  } else { //No Events were Found
391
- $output .= apply_filters( 'ecs_no_events_found_message', sprintf( translate( $atts['message'], 'the-events-calendar' ), tribe_get_event_label_plural_lowercase() ), $atts );
392
  } // endif
393
 
394
  wp_reset_postdata();
3
  Plugin Name: The Events Calendar Shortcode & Block
4
  Plugin URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode/
5
  Description: An addon to add shortcode and new editor block functionality for The Events Calendar Plugin by Modern Tribe.
6
+ Version: 2.5
7
  Author: Event Calendar Newsletter
8
  Author URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode
9
  Contributors: brianhogg
154
  return '';
155
  }
156
 
157
+ global $post, $ecs_last_event_count;
158
  $output = '';
159
 
160
  $atts = shortcode_atts( apply_filters( 'ecs_shortcode_atts', array(
294
  $posts = tribe_get_events( $args );
295
  $posts = apply_filters( 'ecs_filter_events_after_get', $posts, $atts );
296
 
297
+ $ecs_last_event_count = 0;
298
+ if ( $posts or apply_filters( 'ecs_always_show', false, $atts ) ) {
299
  $output = apply_filters( 'ecs_beginning_output', $output, $posts, $atts );
300
  $output .= apply_filters( 'ecs_start_tag', '<ul class="ecs-event-list">', $atts, count( (array) $posts ) );
301
  $atts['contentorder'] = explode( ',', $atts['contentorder'] );
305
  $event_output = '';
306
  if ( apply_filters( 'ecs_skip_event', false, $atts, $post ) )
307
  continue;
308
+ $ecs_last_event_count++;
309
  $category_slugs = array();
310
  $category_list = get_the_terms( $post, 'tribe_events_cat' );
311
  $featured_class = ( get_post_meta( get_the_ID(), '_tribe_featured', true ) ? ' ecs-featured-event' : '' );
390
  }
391
 
392
  } else { //No Events were Found
393
+ $output .= '<div class="ecs-no-events">' . apply_filters( 'ecs_no_events_found_message', sprintf( translate( $atts['message'], 'the-events-calendar' ), tribe_get_event_label_plural_lowercase() ), $atts ) . '</div>';
394
  } // endif
395
 
396
  wp_reset_postdata();