Version Description
- Fix translations for "There are no upcoming events" and "View all events" since The Events Calendar 6.x
Download this release
Release Info
Developer | brianhogg |
Plugin | The Events Calendar Shortcode |
Version | 2.5.6 |
Comparing to | |
See all releases |
Code changes from version 2.5.5 to 2.5.6
- changelog.txt +16 -0
- readme.txt +5 -2
- the-events-calendar-shortcode.php +134 -132
changelog.txt
CHANGED
@@ -1,3 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
= 2.5.2 =
|
2 |
* Initial workaround for styling issues for the block in the new full-site editor
|
3 |
|
1 |
+
= 2.5.6 =
|
2 |
+
* Fix translations for "There are no upcoming events" and "View all events" since The Events Calendar 6.x
|
3 |
+
|
4 |
+
= 2.5.5 =
|
5 |
+
* Fix warning message on the Widgets page
|
6 |
+
* Fix saving the thumbnail settings when using the block
|
7 |
+
|
8 |
+
= 2.5.4.1 =
|
9 |
+
* Reducing permission requirement for instructions page (Authors)
|
10 |
+
|
11 |
+
= 2.5.4 =
|
12 |
+
* Fix broken settings page link
|
13 |
+
|
14 |
+
= 2.5.3 =
|
15 |
+
* Fix for month="next" when near the end of a month
|
16 |
+
|
17 |
= 2.5.2 =
|
18 |
* Initial workaround for styling issues for the block in the new full-site editor
|
19 |
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: brianhogg
|
|
3 |
Tags: event, events, calendar, shortcode, modern tribe
|
4 |
Requires at least: 5.6
|
5 |
Requires PHP: 5.3
|
6 |
-
Tested up to: 6.
|
7 |
-
Stable tag: 2.5.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -180,6 +180,9 @@ The [pro version of the plugin](https://eventcalendarnewsletter.com/the-events-c
|
|
180 |
|
181 |
== Upgrade Notice ==
|
182 |
|
|
|
|
|
|
|
183 |
= 2.5.5 =
|
184 |
* Fix warning message on the Widgets page
|
185 |
* Fix saving the thumbnail settings when using the block
|
3 |
Tags: event, events, calendar, shortcode, modern tribe
|
4 |
Requires at least: 5.6
|
5 |
Requires PHP: 5.3
|
6 |
+
Tested up to: 6.1
|
7 |
+
Stable tag: 2.5.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
180 |
|
181 |
== Upgrade Notice ==
|
182 |
|
183 |
+
= 2.5.6 =
|
184 |
+
* Fix translations for "There are no upcoming events" and "View all events" since The Events Calendar 6.x
|
185 |
+
|
186 |
= 2.5.5 =
|
187 |
* Fix warning message on the Widgets page
|
188 |
* Fix saving the thumbnail settings when using the block
|
the-events-calendar-shortcode.php
CHANGED
@@ -3,14 +3,16 @@
|
|
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
|
10 |
License: GPL2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
Text Domain: the-events-calendar-shortcode
|
13 |
-
|
|
|
|
|
14 |
|
15 |
// Avoid direct calls to this file
|
16 |
if ( !defined( 'ABSPATH' ) ) {
|
@@ -55,7 +57,7 @@ if ( ! class_exists( 'Events_Calendar_Shortcode' ) ) {
|
|
55 |
*
|
56 |
* @since 1.0.0
|
57 |
*/
|
58 |
-
const VERSION = '2.5.
|
59 |
|
60 |
private $admin_page = null;
|
61 |
|
@@ -159,28 +161,28 @@ if ( ! class_exists( 'Events_Calendar_Shortcode' ) ) {
|
|
159 |
$output = '';
|
160 |
|
161 |
$atts = shortcode_atts( apply_filters( 'ecs_shortcode_atts', array(
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
|
185 |
// Category
|
186 |
if ( $atts['cat'] ) {
|
@@ -192,23 +194,23 @@ if ( ! class_exists( 'Events_Calendar_Shortcode' ) ) {
|
|
192 |
}
|
193 |
|
194 |
$atts['event_tax'] = array(
|
195 |
-
|
196 |
-
|
197 |
|
198 |
foreach ( $atts['cats'] as $cat ) {
|
199 |
$atts['event_tax'][] = array(
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
}
|
213 |
}
|
214 |
|
@@ -238,13 +240,13 @@ if ( ! class_exists( 'Events_Calendar_Shortcode' ) ) {
|
|
238 |
|
239 |
// Date
|
240 |
$atts['meta_date'] = array(
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
|
249 |
// Specific Month
|
250 |
if ( 'current' == $atts['month'] ) {
|
@@ -263,35 +265,35 @@ if ( ! class_exists( 'Events_Calendar_Shortcode' ) ) {
|
|
263 |
$month_enddate = date( 'Y-m-01', strtotime( '+1 month', strtotime( $month_startdate ) ) );
|
264 |
|
265 |
$atts['meta_date'] = array(
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
}
|
281 |
|
282 |
$atts = apply_filters( 'ecs_atts_pre_query', $atts, $meta_date_date, $meta_date_compare );
|
283 |
$args = apply_filters( 'ecs_get_events_args', array(
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
|
296 |
$posts = tribe_get_events( $args );
|
297 |
$posts = apply_filters( 'ecs_filter_events_after_get', $posts, $atts );
|
@@ -322,63 +324,63 @@ if ( ! class_exists( 'Events_Calendar_Shortcode' ) ) {
|
|
322 |
// Put Values into $event_output
|
323 |
foreach ( apply_filters( 'ecs_event_contentorder', $atts['contentorder'], $atts, $post ) as $contentorder ) {
|
324 |
switch ( trim( $contentorder ) ) {
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
|
|
342 |
}
|
343 |
}
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
}
|
382 |
}
|
383 |
$event_output .= apply_filters( 'ecs_event_end_tag', '</li>', $atts, $post );
|
384 |
$output .= apply_filters( 'ecs_single_event_output', $event_output, $atts, $post, $post_index, $posts );
|
@@ -387,13 +389,13 @@ if ( ! class_exists( 'Events_Calendar_Shortcode' ) ) {
|
|
387 |
$output = apply_filters( 'ecs_ending_output', $output, $posts, $atts );
|
388 |
|
389 |
if ( self::isValid( $atts['viewall'] ) ) {
|
390 |
-
$output .= apply_filters( 'ecs_view_all_events_tag_start', '<span class="ecs-all-events">', $atts ) .
|
391 |
-
|
392 |
-
$output .= apply_filters( 'ecs_view_all_events_tag_end', '</span>' );
|
393 |
}
|
394 |
-
} else {
|
395 |
-
$output .= '<div class="ecs-no-events">' . apply_filters( 'ecs_no_events_found_message', sprintf(
|
396 |
-
}
|
397 |
|
398 |
wp_reset_postdata();
|
399 |
|
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.6
|
7 |
Author: Event Calendar Newsletter
|
8 |
Author URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode
|
9 |
Contributors: brianhogg
|
10 |
License: GPL2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
Text Domain: the-events-calendar-shortcode
|
13 |
+
Requires at least: 5.6
|
14 |
+
Requires PHP: 5.3
|
15 |
+
*/
|
16 |
|
17 |
// Avoid direct calls to this file
|
18 |
if ( !defined( 'ABSPATH' ) ) {
|
57 |
*
|
58 |
* @since 1.0.0
|
59 |
*/
|
60 |
+
const VERSION = '2.5.6';
|
61 |
|
62 |
private $admin_page = null;
|
63 |
|
161 |
$output = '';
|
162 |
|
163 |
$atts = shortcode_atts( apply_filters( 'ecs_shortcode_atts', array(
|
164 |
+
'cat' => '',
|
165 |
+
'month' => '',
|
166 |
+
'limit' => 5,
|
167 |
+
'eventdetails' => 'true',
|
168 |
+
'time' => null,
|
169 |
+
'past' => null,
|
170 |
+
'venue' => 'false',
|
171 |
+
'author' => null,
|
172 |
+
'schema' => 'true',
|
173 |
+
'message' => 'There are no upcoming %1$s.',
|
174 |
+
'key' => 'End Date',
|
175 |
+
'order' => 'ASC',
|
176 |
+
'orderby' => 'startdate',
|
177 |
+
'viewall' => 'false',
|
178 |
+
'excerpt' => 'false',
|
179 |
+
'thumb' => 'false',
|
180 |
+
'thumbsize' => '',
|
181 |
+
'thumbwidth' => '',
|
182 |
+
'thumbheight' => '',
|
183 |
+
'contentorder' => apply_filters( 'ecs_default_contentorder', 'title, thumbnail, excerpt, date, venue', $atts ),
|
184 |
+
'event_tax' => '',
|
185 |
+
), $atts ), $atts, 'ecs-list-events' );
|
186 |
|
187 |
// Category
|
188 |
if ( $atts['cat'] ) {
|
194 |
}
|
195 |
|
196 |
$atts['event_tax'] = array(
|
197 |
+
'relation' => 'OR',
|
198 |
+
);
|
199 |
|
200 |
foreach ( $atts['cats'] as $cat ) {
|
201 |
$atts['event_tax'][] = array(
|
202 |
+
'relation' => 'OR',
|
203 |
+
array(
|
204 |
+
'taxonomy' => 'tribe_events_cat',
|
205 |
+
'field' => 'name',
|
206 |
+
'terms' => $cat,
|
207 |
+
),
|
208 |
+
array(
|
209 |
+
'taxonomy' => 'tribe_events_cat',
|
210 |
+
'field' => 'slug',
|
211 |
+
'terms' => $cat,
|
212 |
+
),
|
213 |
+
);
|
214 |
}
|
215 |
}
|
216 |
|
240 |
|
241 |
// Date
|
242 |
$atts['meta_date'] = array(
|
243 |
+
array(
|
244 |
+
'key' => $atts['key'],
|
245 |
+
'value' => $meta_date_date,
|
246 |
+
'compare' => $meta_date_compare,
|
247 |
+
'type' => 'DATETIME',
|
248 |
+
),
|
249 |
+
);
|
250 |
|
251 |
// Specific Month
|
252 |
if ( 'current' == $atts['month'] ) {
|
265 |
$month_enddate = date( 'Y-m-01', strtotime( '+1 month', strtotime( $month_startdate ) ) );
|
266 |
|
267 |
$atts['meta_date'] = array(
|
268 |
+
'relation' => 'AND',
|
269 |
+
array(
|
270 |
+
'key' => $atts['key'],
|
271 |
+
'value' => $month_startdate,
|
272 |
+
'compare' => '>=',
|
273 |
+
'type' => 'DATETIME',
|
274 |
+
),
|
275 |
+
array(
|
276 |
+
'key' => $atts['key'],
|
277 |
+
'value' => $month_enddate,
|
278 |
+
'compare' => '<',
|
279 |
+
'type' => 'DATETIME',
|
280 |
+
),
|
281 |
+
);
|
282 |
}
|
283 |
|
284 |
$atts = apply_filters( 'ecs_atts_pre_query', $atts, $meta_date_date, $meta_date_compare );
|
285 |
$args = apply_filters( 'ecs_get_events_args', array(
|
286 |
+
'post_status' => 'publish',
|
287 |
+
'hide_upcoming' => true,
|
288 |
+
'posts_per_page' => $atts['limit'],
|
289 |
+
'tax_query' => $atts['event_tax'],
|
290 |
+
// Likely want to revamp this logic and separate the ordering from the date filtering
|
291 |
+
'meta_key' => ( ( trim( $atts['orderby'] ) and 'title' != $atts['orderby'] ) ? $atts['orderby'] : $atts['key'] ),
|
292 |
+
'orderby' => ( $atts['orderby'] == 'title' ? 'title' : 'event_date' ),
|
293 |
+
'author' => $atts['author'],
|
294 |
+
'order' => $atts['order'],
|
295 |
+
'meta_query' => apply_filters( 'ecs_get_meta_query', array( $atts['meta_date'] ), $atts, $meta_date_date, $meta_date_compare ),
|
296 |
+
), $atts, $meta_date_date, $meta_date_compare );
|
297 |
|
298 |
$posts = tribe_get_events( $args );
|
299 |
$posts = apply_filters( 'ecs_filter_events_after_get', $posts, $atts );
|
324 |
// Put Values into $event_output
|
325 |
foreach ( apply_filters( 'ecs_event_contentorder', $atts['contentorder'], $atts, $post ) as $contentorder ) {
|
326 |
switch ( trim( $contentorder ) ) {
|
327 |
+
case 'title':
|
328 |
+
$event_output .= apply_filters( 'ecs_event_title_tag_start', '<h4 class="entry-title summary">', $atts, $post ) .
|
329 |
+
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 ) .
|
330 |
+
apply_filters( 'ecs_event_title_tag_end', '</h4>', $atts, $post );
|
331 |
+
break;
|
332 |
+
|
333 |
+
case 'thumbnail':
|
334 |
+
if ( self::isValid( $atts['thumb'] ) ) {
|
335 |
+
$thumbWidth = is_numeric( $atts['thumbwidth'] ) ? $atts['thumbwidth'] : '';
|
336 |
+
$thumbHeight = is_numeric( $atts['thumbheight'] ) ? $atts['thumbheight'] : '';
|
337 |
+
if ( !empty( $thumbWidth ) && !empty( $thumbHeight ) ) {
|
338 |
+
$event_output .= apply_filters( 'ecs_event_thumbnail', get_the_post_thumbnail( get_the_ID(), apply_filters( 'ecs_event_thumbnail_size', array( $thumbWidth, $thumbHeight ), $atts, $post ) ), $atts, $post );
|
339 |
+
} else {
|
340 |
+
if ( $thumb = get_the_post_thumbnail( get_the_ID(), apply_filters( 'ecs_event_thumbnail_size', ( trim( $atts['thumbsize'] ) ? trim( $atts['thumbsize'] ) : 'medium' ), $atts, $post ) ) ) {
|
341 |
+
$event_output .= apply_filters( 'ecs_event_thumbnail_link_start', '<a href="' . tribe_get_event_link() . '">', $atts, $post );
|
342 |
+
$event_output .= apply_filters( 'ecs_event_thumbnail', $thumb, $atts, $post );
|
343 |
+
$event_output .= apply_filters( 'ecs_event_thumbnail_link_end', '</a>', $atts, $post );
|
344 |
+
}
|
345 |
}
|
346 |
}
|
347 |
+
break;
|
348 |
+
|
349 |
+
case 'excerpt':
|
350 |
+
if ( self::isValid( $atts['excerpt'] ) ) {
|
351 |
+
$excerptLength = is_numeric( $atts['excerpt'] ) ? intval( $atts['excerpt'] ) : 100;
|
352 |
+
$event_output .= apply_filters( 'ecs_event_excerpt_tag_start', '<p class="ecs-excerpt">', $atts, $post ) .
|
353 |
+
apply_filters( 'ecs_event_excerpt', self::get_excerpt( $excerptLength ), $atts, $post, $excerptLength ) .
|
354 |
+
apply_filters( 'ecs_event_excerpt_tag_end', '</p>', $atts, $post );
|
355 |
+
}
|
356 |
+
break;
|
357 |
+
|
358 |
+
case 'date':
|
359 |
+
if ( self::isValid( $atts['eventdetails'] ) ) {
|
360 |
+
$event_output .= apply_filters( 'ecs_event_date_tag_start', '<span class="duration time">', $atts, $post ) .
|
361 |
+
apply_filters( 'ecs_event_list_details', tribe_events_event_schedule_details(), $atts, $post ) .
|
362 |
+
apply_filters( 'ecs_event_date_tag_end', '</span>', $atts, $post );
|
363 |
+
}
|
364 |
+
break;
|
365 |
+
|
366 |
+
case 'venue':
|
367 |
+
if ( self::isValid( $atts['venue'] ) and function_exists( 'tribe_has_venue' ) and tribe_has_venue() ) {
|
368 |
+
$event_output .= apply_filters( 'ecs_event_venue_tag_start', '<span class="duration venue">', $atts, $post ) .
|
369 |
+
apply_filters( 'ecs_event_venue_at_tag_start', '<em> ', $atts, $post ) .
|
370 |
+
apply_filters( 'ecs_event_venue_at_text', __( 'at', 'the-events-calendar-shortcode' ), $atts, $post ) .
|
371 |
+
apply_filters( 'ecs_event_venue_at_tag_end', ' </em>', $atts, $post ) .
|
372 |
+
apply_filters( 'ecs_event_list_venue', tribe_get_venue(), $atts, $post ) .
|
373 |
+
apply_filters( 'ecs_event_venue_tag_end', '</span>', $atts, $post );
|
374 |
+
}
|
375 |
+
break;
|
376 |
+
case 'date_thumb':
|
377 |
+
if ( self::isValid( $atts['eventdetails'] ) ) {
|
378 |
+
$event_output .= apply_filters( 'ecs_event_date_thumb', '<div class="date_thumb"><div class="month">' . tribe_get_start_date( null, false, 'M' ) . '</div><div class="day">' . tribe_get_start_date( null, false, 'j' ) . '</div></div>', $atts, $post );
|
379 |
+
}
|
380 |
+
break;
|
381 |
+
default:
|
382 |
+
$event_output .= apply_filters( 'ecs_event_list_output_custom_' . strtolower( trim( $contentorder ) ), '', $atts, $post );
|
383 |
+
}
|
|
|
384 |
}
|
385 |
$event_output .= apply_filters( 'ecs_event_end_tag', '</li>', $atts, $post );
|
386 |
$output .= apply_filters( 'ecs_single_event_output', $event_output, $atts, $post, $post_index, $posts );
|
389 |
$output = apply_filters( 'ecs_ending_output', $output, $posts, $atts );
|
390 |
|
391 |
if ( self::isValid( $atts['viewall'] ) ) {
|
392 |
+
$output .= apply_filters( 'ecs_view_all_events_tag_start', '<div class="ecs-view-all-events"><span class="ecs-all-events">', $atts ) .
|
393 |
+
'<a href="' . apply_filters( 'ecs_event_list_viewall_link', tribe_get_events_link(), $atts ) . '" rel="bookmark">' . apply_filters( 'ecs_view_all_events_text', sprintf( __( 'View all %s', 'the-events-calendar' ), tribe_get_event_label_plural_lowercase() ), $atts ) . '</a>';
|
394 |
+
$output .= apply_filters( 'ecs_view_all_events_tag_end', '</span></div>' );
|
395 |
}
|
396 |
+
} else {
|
397 |
+
$output .= '<div class="ecs-no-events">' . apply_filters( 'ecs_no_events_found_message', sprintf( _x( $atts['message'], 'A message to indicate there are no upcoming events.', 'the-events-calendar' ), tribe_get_event_label_plural_lowercase() ), $atts ) . '</div>';
|
398 |
+
}
|
399 |
|
400 |
wp_reset_postdata();
|
401 |
|