The Events Calendar Shortcode - Version 1.10

Version Description

  • Fix for multi-word category names not working with the "cat" option
  • Option to show "powered by" link
Download this release

Release Info

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

Code changes from version 1.9 to 1.10

includes/ajax-endpoints.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Save the option to show a link underneath events or not
4
+ */
5
+ function ajax_ecs_save_show_link_value() {
6
+ if ( ! is_user_logged_in() || ! wp_verify_nonce( $_POST['nonce'], 'ecs-link-nonce' ) ) {
7
+ die(-1);
8
+ }
9
+
10
+ update_option( 'ecs-show-link', ( isset( $_POST['value'] ) && 'true' == $_POST['value'] ) ? true : false );
11
+ wp_send_json( [
12
+ 'success' => 'true',
13
+ 'value' => get_option( 'ecs-show-link' ) ? true : false
14
+ ] );
15
+ }
16
+
17
+ add_action( 'wp_ajax_ecs_show_link', 'ajax_ecs_save_show_link_value' );
includes/notices/discounts.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ define( 'ECS_DISCOUNT_OPTION_NAME', 'ecs_hide_discounts_notice_q4_2018' );
4
+
5
+ function ecs_setup_discounts_notice() {
6
+ if ( defined( 'TECS_VERSION' ) ||
7
+ get_option( 'ecs_hide_discounts_notice_q4_2018', false ) ||
8
+ time() > strtotime( '2018-11-30 23:59:59' ) ) {
9
+ return;
10
+ }
11
+ add_action( 'admin_notices', 'ecs_display_discounts_notice' );
12
+ }
13
+ add_action( 'admin_init', 'ecs_setup_discounts_notice' );
14
+
15
+ function ecs_display_discounts_notice() {
16
+ $screen = get_current_screen();
17
+ if ( ! is_object( $screen ) ||
18
+ (
19
+ 'dashboard' !== $screen->id &&
20
+ 'tribe_events' !== $screen->post_type
21
+ ) ) {
22
+ return;
23
+ }
24
+ ?>
25
+ <div class="notice notice-success ecs_notice_server ecs-dismissible-notice is-dismissible">
26
+ <h3><?php esc_html_e( 'Save on The Events Calendar Shortcode PRO for a limited time.', 'the-events-calendar-shortcode' ); ?></h3>
27
+ <p><?php esc_html_e( 'Our annual sale is a good opportunity to get beautiful designs and more options for your event listings. Don’t miss out!', 'the-events-calendar-shortcode' ); ?></p>
28
+ <p>
29
+ <a class="ecs-button button button-primary" target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=q4-2018-promo&utm_content=description">
30
+ <?php esc_html_e( 'Get The Events Calendar Shortcode PRO', 'the-events-calendar-shortcode' ); ?>
31
+ </a>
32
+ </p>
33
+ <script>jQuery(function($) {$(document).on("click", ".ecs-dismissible-notice .notice-dismiss",function dismiss() {$.ajax(window.ajaxurl,{type: "POST",data: {action: "ecs_dismiss_discounts_notice"}});});});</script><p></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>
34
+ <?php
35
+ }
36
+
37
+ function ecs_dismiss_discounts_notice() {
38
+ update_option( 'ecs_hide_discounts_notice_q4_2018', true );
39
+ }
40
+ add_action( 'wp_ajax_ecs_dismiss_discounts_notice', 'ecs_dismiss_discounts_notice' );
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.9
6
- Stable tag: 1.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -17,6 +17,8 @@ With this plugin, just add the shortcode on a page to display a list of your eve
17
 
18
  `[ecs-list-events cat="festival" limit="8"]`
19
 
 
 
20
  = Shortcode Options: =
21
  * Basic shortcode: `[ecs-list-events]`
22
  * cat - Represents single event category. `[ecs-list-events cat='festival']` Use commas when you want multiple categories `[ecs-list-events cat='festival, workshops']`
@@ -113,6 +115,7 @@ With [The Events Calendar Shortcode PRO](https://eventcalendarnewsletter.com/the
113
  * timeonly - To show just the start time of the event. `[ecs-list-events timeonly='true']`
114
  * 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
115
  * custom design - Create one or more of your own templates for use with the shortcode
 
116
  * hiderecurring - To only show the first instance of a recurring event, set to 'true'
117
 
118
  [Get 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-bottom&utm_content=description)
@@ -155,6 +158,10 @@ The [pro version of the plugin](https://eventcalendarnewsletter.com/the-events-c
155
 
156
  == Upgrade Notice ==
157
 
 
 
 
 
158
  = 1.9 =
159
  * Adds check for minimum WordPress and PHP version
160
  * Adds a link to a short tutorial video
@@ -247,6 +254,10 @@ Fix missing ul
247
 
248
  == Changelog ==
249
 
 
 
 
 
250
  = 1.9 =
251
  * Adds check for minimum WordPress and PHP version
252
  * Adds a link to a short tutorial video
2
  Contributors: brianhogg
3
  Tags: event, events, calendar, shortcode, modern tribe
4
  Requires at least: 4.1
5
+ Tested up to: 5.0
6
+ Stable tag: 1.10
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
17
 
18
  `[ecs-list-events cat="festival" limit="8"]`
19
 
20
+ [youtube https://www.youtube.com/watch?v=0okrUs-xOq4]
21
+
22
  = Shortcode Options: =
23
  * Basic shortcode: `[ecs-list-events]`
24
  * cat - Represents single event category. `[ecs-list-events cat='festival']` Use commas when you want multiple categories `[ecs-list-events cat='festival, workshops']`
115
  * timeonly - To show just the start time of the event. `[ecs-list-events timeonly='true']`
116
  * 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
117
  * custom design - Create one or more of your own templates for use with the shortcode
118
+ * filter bar - Allow the user to filter the events shown in the full calendar design (ie. by category, state/province, country, venue, etc)
119
  * hiderecurring - To only show the first instance of a recurring event, set to 'true'
120
 
121
  [Get 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-bottom&utm_content=description)
158
 
159
  == Upgrade Notice ==
160
 
161
+ = 1.10 =
162
+ * Fix for multi-word category names not working with the "cat" option
163
+ * Option to show "powered by" link
164
+
165
  = 1.9 =
166
  * Adds check for minimum WordPress and PHP version
167
  * Adds a link to a short tutorial video
254
 
255
  == Changelog ==
256
 
257
+ = 1.10 =
258
+ * Fix for multi-word category names not working with the "cat" option
259
+ * Option to show "powered by" link
260
+
261
  = 1.9 =
262
  * Adds check for minimum WordPress and PHP version
263
  * Adds a link to a short tutorial video
static/ecs-admin.css CHANGED
@@ -1,5 +1,7 @@
1
  td.styling { border-left: 1px solid #000; padding-left: 10px; }
2
  td blockquote, p.shortcode { font-family: monospace; }
 
 
3
  #ecs-pro-description { padding: 10px; border: 2px solid #f77530; background: white; }
4
  #ecs-pro-description h3.additional-options { padding-top: 30px; }
5
  #ecs-pro-description .ecs-button { text-decoration: none; padding: 6px 12px; background-color: #f77530; color: white; display: inline-block; text-align: center; }
1
  td.styling { border-left: 1px solid #000; padding-left: 10px; }
2
  td blockquote, p.shortcode { font-family: monospace; }
3
+ #ecs-link-display { padding: 10px; border: 1px solid #f7f7f7; background: white; margin: 30px 30px 0 0; }
4
+ #ecs-link-display .toggle-message { color: #f77530; font-style: italic; font-size: 12px; }
5
  #ecs-pro-description { padding: 10px; border: 2px solid #f77530; background: white; }
6
  #ecs-pro-description h3.additional-options { padding-top: 30px; }
7
  #ecs-pro-description .ecs-button { text-decoration: none; padding: 6px 12px; background-color: #f77530; color: white; display: inline-block; text-align: center; }
static/ecs-admin.js CHANGED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($){
2
+ $(document).ready(function(){
3
+ $('#show-ecs-link').on('change', function() {
4
+ $.ajax({
5
+ url: ajaxurl,
6
+ type: 'POST',
7
+ data: {
8
+ 'action': 'ecs_show_link',
9
+ 'value': !! $('#show-ecs-link:checked').length,
10
+ 'nonce': $('#ecs-link-nonce').val()
11
+ },
12
+ success: function(data) {
13
+ $('#ecs-link-display .toggle-message').show();
14
+ setTimeout(function() {
15
+ $('#ecs-link-display .toggle-message').hide();
16
+ }, 5000);
17
+ }
18
+ });
19
+ });
20
+ });
21
+ })(jQuery);
static/ecs-admin.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){e(document).ready(function(){e("#show-ecs-link").on("change",function(){e.ajax({url:ajaxurl,type:"POST",data:{action:"ecs_show_link",value:!!e("#show-ecs-link:checked").length,nonce:e("#ecs-link-nonce").val()},success:function(n){e("#ecs-link-display .toggle-message").show(),setTimeout(function(){e("#ecs-link-display .toggle-message").hide()},5e3)}})})})}(jQuery);
static/the-events-calendar-shortcode-filter-bar-demo.gif ADDED
Binary file
templates/admin-page.php CHANGED
@@ -76,6 +76,13 @@
76
  <blockquote>[ecs-list-events orderby='title']</blockquote>
77
  <?php do_action( 'ecs_admin_page_options_after' ); ?>
78
 
 
 
 
 
 
 
 
79
  </div>
80
 
81
  </td>
@@ -108,7 +115,8 @@
108
  <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-calendar&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/the-events-calendar-shortcode-calendar-demo.gif', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version calendar design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
109
  <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-columns&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/the-events-calendar-shortcode-columns-photo-horizontal-design.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version horizontal/columns/photos design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
110
  <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-grouped&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/the-events-calendar-shortcode-grouped-design.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version grouped design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
111
- </div>
 
112
 
113
  <h3 class="additional-options"><?php echo esc_html__( "In addition to designs, you'll get more options including:", 'the-events-calendar-shortcode' ); ?></h3>
114
  <h4><?php echo esc_html__( 'Number of days', 'the-events-calendar-shortcode' ) ?></h4>
@@ -135,7 +143,9 @@
135
  <p><?php echo esc_html__( 'Only show events in the future even when using the month or year option.', 'the-events-calendar-shortcode' ) ?></p>
136
  <h4><?php echo esc_html__( 'Custom Design', 'the-events-calendar-shortcode' ) ?></h4>
137
  <p><?php echo esc_html__( 'Use the new default or compact designs, or create your own using one or more templates in your theme folder', 'the-events-calendar-shortcode' ) ?></p>
138
- <p><?php echo sprintf( esc_html__( '%sGet The Events Calendar Shortcode PRO%s', 'the-events-calendar-shortcode' ), '<a class="ecs-button" target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-after-options&utm_content=description">', '</a>' ); ?> or <a href="https://demo.eventcalendarnewsletter.com/the-events-calendar-shortcode/">see it in action</p>
 
 
139
  </div>
140
  <?php endif; ?>
141
  </td>
76
  <blockquote>[ecs-list-events orderby='title']</blockquote>
77
  <?php do_action( 'ecs_admin_page_options_after' ); ?>
78
 
79
+ <div id="ecs-link-display">
80
+ <?php wp_nonce_field( 'ecs-link-nonce', 'ecs-link-nonce' ) ?>
81
+ <h2>We hope this plugin is helping you out!</h2>
82
+ <p>Would you like to show your thanks for the plugin? Add a small link underneath your events pointing to The Events Calendar Shortcode project.</p>
83
+ <p><label><input type="checkbox" value="1" id="show-ecs-link"<?php echo ( get_option( 'ecs-show-link' ) ? ' checked' : '' ) ?>> Show small link to The Events Calendar Shortcode</label></p>
84
+ <p class="small toggle-message" style="display:none;">Value saved</p>
85
+ </div>
86
  </div>
87
 
88
  </td>
115
  <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-calendar&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/the-events-calendar-shortcode-calendar-demo.gif', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version calendar design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
116
  <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-columns&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/the-events-calendar-shortcode-columns-photo-horizontal-design.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version horizontal/columns/photos design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
117
  <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-grouped&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/the-events-calendar-shortcode-grouped-design.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version grouped design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
118
+ <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-filter-bar&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/the-events-calendar-shortcode-filter-bar-demo.gif', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version filter bar example', 'the-events-calendar-shortcode' ) ); ?></a></p>
119
+ </div>
120
 
121
  <h3 class="additional-options"><?php echo esc_html__( "In addition to designs, you'll get more options including:", 'the-events-calendar-shortcode' ); ?></h3>
122
  <h4><?php echo esc_html__( 'Number of days', 'the-events-calendar-shortcode' ) ?></h4>
143
  <p><?php echo esc_html__( 'Only show events in the future even when using the month or year option.', 'the-events-calendar-shortcode' ) ?></p>
144
  <h4><?php echo esc_html__( 'Custom Design', 'the-events-calendar-shortcode' ) ?></h4>
145
  <p><?php echo esc_html__( 'Use the new default or compact designs, or create your own using one or more templates in your theme folder', 'the-events-calendar-shortcode' ) ?></p>
146
+ <h4><?php echo esc_html__( 'Filter Bar', 'the-events-calendar-shortcode' ) ?></h4>
147
+ <p><?php echo esc_html__( 'Allow visitors to change what events are displayed wherever you put a calendar view on your site', 'the-events-calendar-shortcode' ) ?></p>
148
+ <p><?php echo sprintf( esc_html__( '%sGet The Events Calendar Shortcode PRO%s', 'the-events-calendar-shortcode' ), '<a class="ecs-button" target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-after-options&utm_content=description">', '</a>' ); ?> or <a href="https://demo.eventcalendarnewsletter.com/the-events-calendar-shortcode/">see it in action</p>
149
  </div>
150
  <?php endif; ?>
151
  </td>
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.9
7
  Author: Event Calendar Newsletter
8
  Author URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode
9
  Contributors: brianhogg
@@ -35,6 +35,9 @@ if ( $this_plugin_checks->pass() === false ) {
35
  return;
36
  }
37
 
 
 
 
38
  /**
39
  * Events calendar shortcode addon main class
40
  *
@@ -52,7 +55,7 @@ class Events_Calendar_Shortcode
52
  *
53
  * @since 1.0.0
54
  */
55
- const VERSION = '1.8';
56
 
57
  private $admin_page = null;
58
 
@@ -72,6 +75,7 @@ class Events_Calendar_Shortcode
72
  add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array( $this, 'add_action_links' ) );
73
  add_shortcode( 'ecs-list-events', array( $this, 'ecs_fetch_events' ) );
74
  add_filter( 'ecs_ending_output', array( $this, 'add_event_schema_json' ), 10, 3 );
 
75
  add_action( 'plugins_loaded', array( $this, 'load_languages' ) );
76
  } // END __construct()
77
 
@@ -114,7 +118,7 @@ class Events_Calendar_Shortcode
114
 
115
  public function enqueue() {
116
  wp_enqueue_style( 'ecs-admin-css', plugins_url( 'static/ecs-admin.css', __FILE__ ), array(), self::VERSION );
117
- wp_enqueue_script( 'ecs-admin-js', plugins_url( 'static/ecs-admin.js', __FILE__ ), array(), self::VERSION );
118
  }
119
 
120
  /**
@@ -192,15 +196,18 @@ class Events_Calendar_Shortcode
192
 
193
  foreach ( $atts['cats'] as $cat ) {
194
  $atts['event_tax'][] = array(
195
- 'taxonomy' => 'tribe_events_cat',
196
- 'field' => 'name',
197
- 'terms' => $cat,
198
- );
199
- $atts['event_tax'][] = array(
200
- 'taxonomy' => 'tribe_events_cat',
201
- 'field' => 'slug',
202
- 'terms' => $cat,
203
- );
 
 
 
204
  }
205
  }
206
 
@@ -271,17 +278,18 @@ class Events_Calendar_Shortcode
271
  }
272
 
273
  $atts = apply_filters( 'ecs_atts_pre_query', $atts, $meta_date_date, $meta_date_compare );
274
- $posts = tribe_get_events( apply_filters( 'ecs_get_events_args', array(
275
- 'post_status' => 'publish',
276
- 'hide_upcoming' => true,
277
- 'posts_per_page' => $atts['limit'],
278
- 'tax_query'=> $atts['event_tax'],
279
- 'meta_key' => ( ( trim( $atts['orderby'] ) and 'title' != $atts['orderby'] ) ? $atts['orderby'] : $atts['key'] ),
280
- 'orderby' => ( $atts['orderby'] == 'title' ? 'title' : 'meta_value' ),
281
- 'author' => $atts['author'],
282
- 'order' => $atts['order'],
283
- 'meta_query' => apply_filters( 'ecs_get_meta_query', array( $atts['meta_date'] ), $atts, $meta_date_date, $meta_date_compare ),
284
- ), $atts, $meta_date_date, $meta_date_compare ) );
 
285
  $posts = apply_filters( 'ecs_filter_events_after_get', $posts, $atts );
286
 
287
  if ( $posts or apply_filters( 'ecs_always_show', false, $atts ) ) {
@@ -386,6 +394,17 @@ class Events_Calendar_Shortcode
386
  return $output;
387
  }
388
 
 
 
 
 
 
 
 
 
 
 
 
389
  public function add_event_schema_json( $output, $posts, $atts ) {
390
  if ( self::isValid( $atts['schema'] ) and $posts and class_exists( 'Tribe__Events__JSON_LD__Event' ) and ( ! defined( 'DOING_AJAX' ) or ! DOING_AJAX ) )
391
  $output .= Tribe__Events__JSON_LD__Event::instance()->get_markup( $posts );
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.10
7
  Author: Event Calendar Newsletter
8
  Author URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode
9
  Contributors: brianhogg
35
  return;
36
  }
37
 
38
+ include_once dirname( TECS_CORE_PLUGIN_FILE ) . '/includes/ajax-endpoints.php';
39
+ include_once dirname( TECS_CORE_PLUGIN_FILE ) . '/includes/notices/discounts.php';
40
+
41
  /**
42
  * Events calendar shortcode addon main class
43
  *
55
  *
56
  * @since 1.0.0
57
  */
58
+ const VERSION = '1.10';
59
 
60
  private $admin_page = null;
61
 
75
  add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array( $this, 'add_action_links' ) );
76
  add_shortcode( 'ecs-list-events', array( $this, 'ecs_fetch_events' ) );
77
  add_filter( 'ecs_ending_output', array( $this, 'add_event_schema_json' ), 10, 3 );
78
+ add_filter( 'ecs_ending_output', array( $this, 'add_ecs_link' ), 10, 3 );
79
  add_action( 'plugins_loaded', array( $this, 'load_languages' ) );
80
  } // END __construct()
81
 
118
 
119
  public function enqueue() {
120
  wp_enqueue_style( 'ecs-admin-css', plugins_url( 'static/ecs-admin.css', __FILE__ ), array(), self::VERSION );
121
+ wp_enqueue_script( 'ecs-admin-js', plugins_url( 'static/ecs-admin.min.js', __FILE__ ), array(), self::VERSION );
122
  }
123
 
124
  /**
196
 
197
  foreach ( $atts['cats'] as $cat ) {
198
  $atts['event_tax'][] = array(
199
+ 'relation' => 'OR',
200
+ array(
201
+ 'taxonomy' => 'tribe_events_cat',
202
+ 'field' => 'name',
203
+ 'terms' => $cat,
204
+ ),
205
+ array(
206
+ 'taxonomy' => 'tribe_events_cat',
207
+ 'field' => 'slug',
208
+ 'terms' => $cat,
209
+ )
210
+ );
211
  }
212
  }
213
 
278
  }
279
 
280
  $atts = apply_filters( 'ecs_atts_pre_query', $atts, $meta_date_date, $meta_date_compare );
281
+ $args = apply_filters( 'ecs_get_events_args', array(
282
+ 'post_status' => 'publish',
283
+ 'hide_upcoming' => true,
284
+ 'posts_per_page' => $atts['limit'],
285
+ 'tax_query'=> $atts['event_tax'],
286
+ 'meta_key' => ( ( trim( $atts['orderby'] ) and 'title' != $atts['orderby'] ) ? $atts['orderby'] : $atts['key'] ),
287
+ 'orderby' => ( $atts['orderby'] == 'title' ? 'title' : 'meta_value' ),
288
+ 'author' => $atts['author'],
289
+ 'order' => $atts['order'],
290
+ 'meta_query' => apply_filters( 'ecs_get_meta_query', array( $atts['meta_date'] ), $atts, $meta_date_date, $meta_date_compare ),
291
+ ), $atts, $meta_date_date, $meta_date_compare );
292
+ $posts = tribe_get_events( $args );
293
  $posts = apply_filters( 'ecs_filter_events_after_get', $posts, $atts );
294
 
295
  if ( $posts or apply_filters( 'ecs_always_show', false, $atts ) ) {
394
  return $output;
395
  }
396
 
397
+ public function add_ecs_link( $output, $posts, $atts ) {
398
+ $output .= "<!--\n Event listing powered by The Events Calendar Shortcode\n https://eventcalendarnewsletter.com/the-events-calendar-shortcode/ \n-->";
399
+ if ( ! get_option( 'ecs-show-link', false ) ) {
400
+ return $output;
401
+ }
402
+ $output .= '<p class="ecs-powered-by-link">';
403
+ $output .= sprintf( esc_html__( 'Event listing powered by %sThe Events Calendar Shortcode%s', 'the-events-calendar-shortcode' ), '<a href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode/?utm_source=footer&utm_campaign=powered-by-link">', '</a>' );
404
+ $output .= '</p>';
405
+ return $output;
406
+ }
407
+
408
  public function add_event_schema_json( $output, $posts, $atts ) {
409
  if ( self::isValid( $atts['schema'] ) and $posts and class_exists( 'Tribe__Events__JSON_LD__Event' ) and ( ! defined( 'DOING_AJAX' ) or ! DOING_AJAX ) )
410
  $output .= Tribe__Events__JSON_LD__Event::instance()->get_markup( $posts );