The Events Calendar Shortcode - Version 1.4.2

Version Description

  • Additional filter for changing the link for an event
  • Adds category CSS classes for each event, so you can format each category differently
Download this release

Release Info

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

Code changes from version 1.4.1 to 1.4.2

Files changed (2) hide show
  1. readme.txt +21 -6
  2. the-events-calendar-shortcode.php +10 -3
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: brianhogg, dandelionweb, ankitpokhrel, sujin2f
3
  Tags: event, events, calendar, shortcode, modern tribe
4
  Requires at least: 4.0
5
- Tested up to: 4.7.2
6
- Stable tag: 1.4.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -36,7 +36,7 @@ With this plugin, just add the shortcode on a page to display a list of your eve
36
  * past - Show Outdated Events. [ecs-list-events cat='festival' past='yes']
37
  * key - Order with Start Date [ecs-list-events cat='festival' key='start date']
38
 
39
- Additional options in the [pro version](https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-top&utm_content=description):
40
 
41
  * design - Shows improved design by default, or set to 'standard' for the regular one and 'compact' for a more compact listing
42
  * 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
@@ -85,9 +85,16 @@ This plugin is not developed by or affiliated with The Events Calendar or Modern
85
  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:
86
 
87
  * design - Shows improved design by default, or set to 'standard' for the regular one and 'compact' for a more compact listing
88
- * days - Number of days to show events for ie. [ecs-list-events days='7'] (for a week)
89
- * hiderecurring - Show only the first instance of a recurring event
90
- * tag - Show events with a tag [ecs-list-events tag='music'] or specify multiple tags [ecs-list-events tag='music,art']
 
 
 
 
 
 
 
91
 
92
  = How do I use this shortcode in a widget? =
93
 
@@ -118,6 +125,10 @@ include echo do_shortcode("[ecs-list-events]"); in the template where you want t
118
 
119
  == Upgrade Notice ==
120
 
 
 
 
 
121
  = 1.4.1 =
122
  * Additional filters for formatting a single event
123
 
@@ -162,6 +173,10 @@ Fix missing ul
162
 
163
  == Changelog ==
164
 
 
 
 
 
165
  = 1.4.1 =
166
  * Additional filters for formatting a single event
167
 
2
  Contributors: brianhogg, dandelionweb, ankitpokhrel, sujin2f
3
  Tags: event, events, calendar, shortcode, modern tribe
4
  Requires at least: 4.0
5
+ Tested up to: 4.7.3
6
+ Stable tag: 1.4.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
36
  * past - Show Outdated Events. [ecs-list-events cat='festival' past='yes']
37
  * key - Order with Start Date [ecs-list-events cat='festival' key='start date']
38
 
39
+ >**[Additional options in the pro version](https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-top&utm_content=description)**
40
 
41
  * design - Shows improved design by default, or set to 'standard' for the regular one and 'compact' for a more compact listing
42
  * 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
85
  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:
86
 
87
  * design - Shows improved design by default, or set to 'standard' for the regular one and 'compact' for a more compact listing
88
+ * 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
89
+ * tag - Filter by one or more tags. Use commas when you want to filter by multiple tags.
90
+ * id - Show a single event, useful for displaying details of the event on a blog post or page
91
+ * description - Use the full description instead of the excerpt of an event in the listing
92
+ * raw_description - Avoid filtering any HTML (spacing, links, bullet points, etc) in the description
93
+ * raw_excerpt - Avoid filtering any HTML (spacing, links, etc) in the excerpt
94
+ * year - Show only events for a specific year
95
+ * 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
96
+ * custom design - Create one or more of your own templates for use with the shortcode
97
+ * hiderecurring - To only show the first instance of a recurring event, set to 'true'
98
 
99
  = How do I use this shortcode in a widget? =
100
 
125
 
126
  == Upgrade Notice ==
127
 
128
+ = 1.4.2 =
129
+ * Additional filter for changing the link for an event
130
+ * Adds category CSS classes for each event, so you can format each category differently
131
+
132
  = 1.4.1 =
133
  * Additional filters for formatting a single event
134
 
173
 
174
  == Changelog ==
175
 
176
+ = 1.4.2 =
177
+ * Additional filter for changing the link for an event
178
+ * Adds category CSS classes for each event, so you can format each category differently
179
+
180
  = 1.4.1 =
181
  * Additional filters for formatting a single event
182
 
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.4.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
@@ -240,14 +240,21 @@ class Events_Calendar_Shortcode
240
  foreach( $posts as $post ) {
241
  setup_postdata( $post );
242
  $event_output = '';
243
- $event_output .= apply_filters( 'ecs_event_start_tag', '<li class="ecs-event">', $atts, $post );
 
 
 
 
 
 
 
244
 
245
  // Put Values into $event_output
246
  foreach ( apply_filters( 'ecs_event_contentorder', $atts['contentorder'], $atts, $post ) as $contentorder ) {
247
  switch ( trim( $contentorder ) ) {
248
  case 'title':
249
  $event_output .= apply_filters( 'ecs_event_title_tag_start', '<h4 class="entry-title summary">', $atts, $post ) .
250
- '<a href="' . tribe_get_event_link() . '" rel="bookmark">' . apply_filters( 'ecs_event_list_title', get_the_title(), $atts, $post ) . '</a>' .
251
  apply_filters( 'ecs_event_title_tag_end', '</h4>', $atts, $post );
252
  break;
253
 
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.4.2
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
240
  foreach( $posts as $post ) {
241
  setup_postdata( $post );
242
  $event_output = '';
243
+ $category_slugs = array();
244
+ $category_list = get_the_terms( $post, 'tribe_events_cat' );
245
+ if ( is_array( $category_list ) ) {
246
+ foreach ( (array) $category_list as $category ) {
247
+ $category_slugs[] = ' ' . $category->slug . '_ecs_category';
248
+ }
249
+ }
250
+ $event_output .= apply_filters( 'ecs_event_start_tag', '<li class="ecs-event' . implode( '', $category_slugs ) . '">', $atts, $post );
251
 
252
  // Put Values into $event_output
253
  foreach ( apply_filters( 'ecs_event_contentorder', $atts['contentorder'], $atts, $post ) as $contentorder ) {
254
  switch ( trim( $contentorder ) ) {
255
  case 'title':
256
  $event_output .= apply_filters( 'ecs_event_title_tag_start', '<h4 class="entry-title summary">', $atts, $post ) .
257
+ apply_filters( 'ecs_event_list_title_link_start', '<a href="' . tribe_get_event_link() . '" rel="bookmark">', $atts, $post ) . apply_filters( 'ecs_event_list_title', get_the_title(), $atts, $post ) . apply_filters( 'ecs_event_list_title_link_end', '</a>', $atts, $post ) .
258
  apply_filters( 'ecs_event_title_tag_end', '</h4>', $atts, $post );
259
  break;
260