The Events Calendar Shortcode - Version 1.7.3

Version Description

  • Hide the "at" when using venue='true' and an event has no venue
  • Adds additional WordPress filters to hide certain events
Download this release

Release Info

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

Code changes from version 1.7.2 to 1.7.3

Files changed (2) hide show
  1. readme.txt +9 -1
  2. the-events-calendar-shortcode.php +7 -4
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -155,6 +155,10 @@ The [pro version of the plugin](https://eventcalendarnewsletter.com/the-events-c
155
 
156
  == Upgrade Notice ==
157
 
 
 
 
 
158
  = 1.7.2 =
159
  * Adds the ability to use schema='false' in the shortcode to hide the schema output
160
 
@@ -234,6 +238,10 @@ Fix missing ul
234
 
235
  == Changelog ==
236
 
 
 
 
 
237
  = 1.7.2 =
238
  * Adds the ability to use schema='false' in the shortcode to hide the schema output
239
 
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.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
155
 
156
  == Upgrade Notice ==
157
 
158
+ = 1.7.3 =
159
+ * Hide the "at" when using venue='true' and an event has no venue
160
+ * Adds additional WordPress filters to hide certain events
161
+
162
  = 1.7.2 =
163
  * Adds the ability to use schema='false' in the shortcode to hide the schema output
164
 
238
 
239
  == Changelog ==
240
 
241
+ = 1.7.3 =
242
+ * Hide the "at" when using venue='true' and an event has no venue
243
+ * Adds additional WordPress filters to hide certain events
244
+
245
  = 1.7.2 =
246
  * Adds the ability to use schema='false' in the shortcode to hide the schema output
247
 
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.2
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.2';
42
 
43
  private $admin_page = null;
44
 
@@ -266,6 +266,7 @@ class Events_Calendar_Shortcode
266
  'order' => $atts['order'],
267
  'meta_query' => apply_filters( 'ecs_get_meta_query', array( $atts['meta_date'] ), $atts, $meta_date_date, $meta_date_compare ),
268
  ), $atts, $meta_date_date, $meta_date_compare ) );
 
269
 
270
  if ( $posts or apply_filters( 'ecs_always_show', false, $atts ) ) {
271
  $output = apply_filters( 'ecs_beginning_output', $output, $posts, $atts );
@@ -275,6 +276,8 @@ class Events_Calendar_Shortcode
275
  foreach( (array) $posts as $post_index => $post ) {
276
  setup_postdata( $post );
277
  $event_output = '';
 
 
278
  $category_slugs = array();
279
  $category_list = get_the_terms( $post, 'tribe_events_cat' );
280
  $featured_class = ( get_post_meta( get_the_ID(), '_tribe_featured', true ) ? ' ecs-featured-event' : '' );
@@ -283,7 +286,7 @@ class Events_Calendar_Shortcode
283
  $category_slugs[] = ' ' . $category->slug . '_ecs_category';
284
  }
285
  }
286
- $event_output .= apply_filters( 'ecs_event_start_tag', '<li class="ecs-event' . implode( '', $category_slugs ) . $featured_class . '">', $atts, $post );
287
 
288
  // Put Values into $event_output
289
  foreach ( apply_filters( 'ecs_event_contentorder', $atts['contentorder'], $atts, $post ) as $contentorder ) {
@@ -328,7 +331,7 @@ class Events_Calendar_Shortcode
328
  break;
329
 
330
  case 'venue':
331
- if ( self::isValid( $atts['venue'] ) ) {
332
  $event_output .= apply_filters( 'ecs_event_venue_tag_start', '<span class="duration venue">', $atts, $post ) .
333
  apply_filters( 'ecs_event_venue_at_tag_start', '<em> ', $atts, $post ) .
334
  apply_filters( 'ecs_event_venue_at_text', __( 'at', 'the-events-calendar-shortcode' ), $atts, $post ) .
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.3
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.3';
42
 
43
  private $admin_page = null;
44
 
266
  'order' => $atts['order'],
267
  'meta_query' => apply_filters( 'ecs_get_meta_query', array( $atts['meta_date'] ), $atts, $meta_date_date, $meta_date_compare ),
268
  ), $atts, $meta_date_date, $meta_date_compare ) );
269
+ $posts = apply_filters( 'ecs_filter_events_after_get', $posts, $atts );
270
 
271
  if ( $posts or apply_filters( 'ecs_always_show', false, $atts ) ) {
272
  $output = apply_filters( 'ecs_beginning_output', $output, $posts, $atts );
276
  foreach( (array) $posts as $post_index => $post ) {
277
  setup_postdata( $post );
278
  $event_output = '';
279
+ if ( apply_filters( 'ecs_skip_event', false, $atts, $post ) )
280
+ continue;
281
  $category_slugs = array();
282
  $category_list = get_the_terms( $post, 'tribe_events_cat' );
283
  $featured_class = ( get_post_meta( get_the_ID(), '_tribe_featured', true ) ? ' ecs-featured-event' : '' );
286
  $category_slugs[] = ' ' . $category->slug . '_ecs_category';
287
  }
288
  }
289
+ $event_output .= apply_filters( 'ecs_event_start_tag', '<li class="ecs-event' . implode( '', $category_slugs ) . $featured_class . apply_filters( 'ecs_event_classes', '', $atts, $post ) . '">', $atts, $post );
290
 
291
  // Put Values into $event_output
292
  foreach ( apply_filters( 'ecs_event_contentorder', $atts['contentorder'], $atts, $post ) as $contentorder ) {
331
  break;
332
 
333
  case 'venue':
334
+ if ( self::isValid( $atts['venue'] ) and function_exists( 'tribe_has_venue' ) and tribe_has_venue() ) {
335
  $event_output .= apply_filters( 'ecs_event_venue_tag_start', '<span class="duration venue">', $atts, $post ) .
336
  apply_filters( 'ecs_event_venue_at_tag_start', '<em> ', $atts, $post ) .
337
  apply_filters( 'ecs_event_venue_at_text', __( 'at', 'the-events-calendar-shortcode' ), $atts, $post ) .