The Events Calendar Shortcode - Version 1.6.1

Version Description

  • Added ecs-featured-event class if event is featured
  • Internal changes to filtering by one or more categories
Download this release

Release Info

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

Code changes from version 1.6 to 1.6.1

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.8
6
- Stable tag: 1.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -45,11 +45,13 @@ With this plugin, just add the shortcode on a page to display a list of your eve
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>
47
  <li>city, state, country - Display events by location.</li>
 
48
  <li>id - Show a single event, useful for displaying details of the event on a blog post or page</li>
49
  <li>description - Use the full description instead of the excerpt of an event in the listing</li>
50
  <li>raw_description - Avoid filtering any HTML (spacing, links, bullet points, etc) in the description</li>
51
  <li>raw_excerpt - Avoid filtering any HTML (spacing, links, etc) in the excerpt</li>
52
  <li>year - Show only events for a specific year</li>
 
53
  <li>timeonly - To show just the start time of the event. [ecs-list-events timeonly='true']</li>
54
  <li>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</li>
55
  <li>custom design - Create one or more of your own templates for use with the shortcode</li>
@@ -104,8 +106,10 @@ With [The Events Calendar Shortcode PRO](https://eventcalendarnewsletter.com/the
104
  * description - Use the full description instead of the excerpt of an event in the listing
105
  * raw_description - Avoid filtering any HTML (spacing, links, bullet points, etc) in the description
106
  * raw_excerpt - Avoid filtering any HTML (spacing, links, etc) in the excerpt
 
107
  * date - Show only events for a specific day `[ecs-list-events date='2017-04-16']`
108
  * year - Show only events for a specific year `[ecs-list-events year='2017']`
 
109
  * timeonly - To show just the start time of the event. `[ecs-list-events timeonly='true']`
110
  * 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
111
  * custom design - Create one or more of your own templates for use with the shortcode
@@ -123,7 +127,7 @@ If a regular text widget doesn't work, put the shortcode in a <a href="https://w
123
  By default the plugin does not include styling. Events are listed in ul li tags with appropriate classes for styling with a bit of CSS.
124
 
125
  * ul class="ecs-event-list"
126
- * li class="ecs-event"
127
  * event title link is H4 class="entry-title summary"
128
  * date class is time
129
  * venue class is venue
@@ -150,6 +154,10 @@ The [pro version of the plugin](https://eventcalendarnewsletter.com/the-events-c
150
 
151
  == Upgrade Notice ==
152
 
 
 
 
 
153
  = 1.6 =
154
  * Changes default ordering by the start date, use orderby="enddate" for previous default ordering
155
 
@@ -215,6 +223,10 @@ Fix missing ul
215
 
216
  == Changelog ==
217
 
 
 
 
 
218
  = 1.6 =
219
  * Changes default ordering by the start date, use orderby="enddate" for previous default ordering
220
 
3
  Tags: event, events, calendar, shortcode, modern tribe
4
  Requires at least: 4.1
5
  Tested up to: 4.8
6
+ Stable tag: 1.6.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
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>
47
  <li>city, state, country - Display events by location.</li>
48
+ <li>featured only - Show only events marked as "featured"</li>
49
  <li>id - Show a single event, useful for displaying details of the event on a blog post or page</li>
50
  <li>description - Use the full description instead of the excerpt of an event in the listing</li>
51
  <li>raw_description - Avoid filtering any HTML (spacing, links, bullet points, etc) in the description</li>
52
  <li>raw_excerpt - Avoid filtering any HTML (spacing, links, etc) in the excerpt</li>
53
  <li>year - Show only events for a specific year</li>
54
+ <li>date range - Show only events between certain days</li>
55
  <li>timeonly - To show just the start time of the event. [ecs-list-events timeonly='true']</li>
56
  <li>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</li>
57
  <li>custom design - Create one or more of your own templates for use with the shortcode</li>
106
  * description - Use the full description instead of the excerpt of an event in the listing
107
  * raw_description - Avoid filtering any HTML (spacing, links, bullet points, etc) in the description
108
  * raw_excerpt - Avoid filtering any HTML (spacing, links, etc) in the excerpt
109
+ * featured only - Show only events marked as "featured"
110
  * date - Show only events for a specific day `[ecs-list-events date='2017-04-16']`
111
  * year - Show only events for a specific year `[ecs-list-events year='2017']`
112
+ * date range - Show only events between certain days `[ecs-list-events fromdate='2017-05-31' todate='2017-06-15']`
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
127
  By default the plugin does not include styling. Events are listed in ul li tags with appropriate classes for styling with a bit of CSS.
128
 
129
  * ul class="ecs-event-list"
130
+ * li class="ecs-event" and "ecs-featured-event" (if featured)
131
  * event title link is H4 class="entry-title summary"
132
  * date class is time
133
  * venue class is venue
154
 
155
  == Upgrade Notice ==
156
 
157
+ = 1.6.1 =
158
+ * Added ecs-featured-event class if event is featured
159
+ * Internal changes to filtering by one or more categories
160
+
161
  = 1.6 =
162
  * Changes default ordering by the start date, use orderby="enddate" for previous default ordering
163
 
223
 
224
  == Changelog ==
225
 
226
+ = 1.6.1 =
227
+ * Added ecs-featured-event class if event is featured
228
+ * Internal changes to filtering by one or more categories
229
+
230
  = 1.6 =
231
  * Changes default ordering by the start date, use orderby="enddate" for previous default ordering
232
 
templates/admin-page.php CHANGED
@@ -86,7 +86,7 @@
86
 
87
  <ul>
88
  <li>ul class="ecs-event-list"</li>
89
- <li>li class="ecs-event"</li>
90
  <li><?php echo esc_html( sprintf( __( 'event title link is %s', 'the-events-calendar-shortcode' ), 'H4 class="entry-title summary"' ) ); ?> </li>
91
  <li><?php echo esc_html( sprintf( __( 'date class is %s', 'the-events-calendar-shortcode' ), 'time' ) ); ?></li>
92
  <li><?php echo esc_html( sprintf( __( 'venue class is %s', 'the-events-calendar-shortcode' ), 'venue' ) ); ?></li>
@@ -97,7 +97,7 @@
97
  <div id="ecs-pro-description">
98
 
99
  <h3><?php echo esc_html__( 'Want a better looking design without adding any CSS?', 'the-events-calendar-shortcode' ) ?></h3>
100
- <p><?php echo sprintf( esc_html__( 'Check out %sThe Events Calendar Shortcode PRO%s', 'the-events-calendar-shortcode' ), '<a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design&utm_content=description">', '</a>' ); ?></p>
101
  <div id="ecs-pro-designs">
102
  <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-1&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/shortcode-default-design-2.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version default design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
103
  <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-2&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/event-calendar-shortcode-compact-design.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version compact design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
@@ -114,6 +114,8 @@
114
  <p><?php echo esc_html__( 'Display events by city, state/province, or country', 'the-events-calendar-shortcode' ) ?></p>
115
  <h4><?php echo esc_html__( 'Single Event', 'the-events-calendar-shortcode' ) ?></h4>
116
  <p><?php echo esc_html__( 'List the details of a single event by ID, for example on a blog post', 'the-events-calendar-shortcode' ) ?></p>
 
 
117
  <h4><?php echo esc_html__( 'Button', 'the-events-calendar-shortcode' ) ?></h4>
118
  <p><?php echo esc_html__( 'Add an easy to see button link to your event, and customize the colors/text', 'the-events-calendar-shortcode' ) ?></p>
119
  <h4><?php echo esc_html__( 'Date', 'the-events-calendar-shortcode' ) ?></h4>
86
 
87
  <ul>
88
  <li>ul class="ecs-event-list"</li>
89
+ <li>li class="ecs-event" &amp; "ecs-featured-event" <?php echo esc_html( __( '(if featured)', 'the-events-calendar-shortcode' ) ) ?></li>
90
  <li><?php echo esc_html( sprintf( __( 'event title link is %s', 'the-events-calendar-shortcode' ), 'H4 class="entry-title summary"' ) ); ?> </li>
91
  <li><?php echo esc_html( sprintf( __( 'date class is %s', 'the-events-calendar-shortcode' ), 'time' ) ); ?></li>
92
  <li><?php echo esc_html( sprintf( __( 'venue class is %s', 'the-events-calendar-shortcode' ), 'venue' ) ); ?></li>
97
  <div id="ecs-pro-description">
98
 
99
  <h3><?php echo esc_html__( 'Want a better looking design without adding any CSS?', 'the-events-calendar-shortcode' ) ?></h3>
100
+ <p><?php echo sprintf( esc_html__( 'Check out %sThe Events Calendar Shortcode PRO%s. Some examples of the designs:', 'the-events-calendar-shortcode' ), '<a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design&utm_content=description">', '</a>' ); ?></p>
101
  <div id="ecs-pro-designs">
102
  <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-1&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/shortcode-default-design-2.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version default design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
103
  <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-2&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/event-calendar-shortcode-compact-design.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version compact design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
114
  <p><?php echo esc_html__( 'Display events by city, state/province, or country', 'the-events-calendar-shortcode' ) ?></p>
115
  <h4><?php echo esc_html__( 'Single Event', 'the-events-calendar-shortcode' ) ?></h4>
116
  <p><?php echo esc_html__( 'List the details of a single event by ID, for example on a blog post', 'the-events-calendar-shortcode' ) ?></p>
117
+ <h4><?php echo esc_html__( 'Featured', 'the-events-calendar-shortcode' ) ?></h4>
118
+ <p><?php echo esc_html__( 'Show only events marked as "featured"', 'the-events-calendar-shortcode' ) ?></p>
119
  <h4><?php echo esc_html__( 'Button', 'the-events-calendar-shortcode' ) ?></h4>
120
  <p><?php echo esc_html__( 'Add an easy to see button link to your event, and customize the colors/text', 'the-events-calendar-shortcode' ) ?></p>
121
  <h4><?php echo esc_html__( 'Date', 'the-events-calendar-shortcode' ) ?></h4>
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 (Free Version) by Modern Tribe</a>.
6
- Version: 1.6
7
  Author: Event Calendar Newsletter
8
  Author URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode/
9
  Contributors: Brainchild Media Group, Reddit user miahelf, tallavic, hejeva2
@@ -38,7 +38,7 @@ class Events_Calendar_Shortcode
38
  *
39
  * @since 1.0.0
40
  */
41
- const VERSION = '1.6';
42
 
43
  private $admin_page = null;
44
 
@@ -168,22 +168,25 @@ class Events_Calendar_Shortcode
168
  $atts['cats'] = explode( ",", $atts['cat'] );
169
  $atts['cats'] = array_map( 'trim', $atts['cats'] );
170
  } else {
171
- $atts['cats'] = $atts['cat'];
172
  }
173
 
174
  $atts['event_tax'] = array(
175
  'relation' => 'OR',
176
- array(
 
 
 
177
  'taxonomy' => 'tribe_events_cat',
178
  'field' => 'name',
179
- 'terms' => $atts['cats'],
180
- ),
181
- array(
182
  'taxonomy' => 'tribe_events_cat',
183
  'field' => 'slug',
184
- 'terms' => $atts['cats'],
185
- )
186
- );
187
  }
188
 
189
  // Past Event
@@ -264,12 +267,13 @@ class Events_Calendar_Shortcode
264
  $event_output = '';
265
  $category_slugs = array();
266
  $category_list = get_the_terms( $post, 'tribe_events_cat' );
 
267
  if ( is_array( $category_list ) ) {
268
  foreach ( (array) $category_list as $category ) {
269
  $category_slugs[] = ' ' . $category->slug . '_ecs_category';
270
  }
271
  }
272
- $event_output .= apply_filters( 'ecs_event_start_tag', '<li class="ecs-event' . implode( '', $category_slugs ) . '">', $atts, $post );
273
 
274
  // Put Values into $event_output
275
  foreach ( apply_filters( 'ecs_event_contentorder', $atts['contentorder'], $atts, $post ) as $contentorder ) {
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 (Free Version) by Modern Tribe</a>.
6
+ Version: 1.6.1
7
  Author: Event Calendar Newsletter
8
  Author URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode/
9
  Contributors: Brainchild Media Group, Reddit user miahelf, tallavic, hejeva2
38
  *
39
  * @since 1.0.0
40
  */
41
+ const VERSION = '1.6.1';
42
 
43
  private $admin_page = null;
44
 
168
  $atts['cats'] = explode( ",", $atts['cat'] );
169
  $atts['cats'] = array_map( 'trim', $atts['cats'] );
170
  } else {
171
+ $atts['cats'] = array( trim( $atts['cat'] ) );
172
  }
173
 
174
  $atts['event_tax'] = array(
175
  'relation' => 'OR',
176
+ );
177
+
178
+ foreach ( $atts['cats'] as $cat ) {
179
+ $atts['event_tax'][] = array(
180
  'taxonomy' => 'tribe_events_cat',
181
  'field' => 'name',
182
+ 'terms' => $cat,
183
+ );
184
+ $atts['event_tax'][] = array(
185
  'taxonomy' => 'tribe_events_cat',
186
  'field' => 'slug',
187
+ 'terms' => $cat,
188
+ );
189
+ }
190
  }
191
 
192
  // Past Event
267
  $event_output = '';
268
  $category_slugs = array();
269
  $category_list = get_the_terms( $post, 'tribe_events_cat' );
270
+ $featured_class = ( get_post_meta( get_the_ID(), '_tribe_featured', true ) ? ' ecs-featured-event' : '' );
271
  if ( is_array( $category_list ) ) {
272
  foreach ( (array) $category_list as $category ) {
273
  $category_slugs[] = ' ' . $category->slug . '_ecs_category';
274
  }
275
  }
276
+ $event_output .= apply_filters( 'ecs_event_start_tag', '<li class="ecs-event' . implode( '', $category_slugs ) . $featured_class . '">', $atts, $post );
277
 
278
  // Put Values into $event_output
279
  foreach ( apply_filters( 'ecs_event_contentorder', $atts['contentorder'], $atts, $post ) as $contentorder ) {