Skip to content

Commit 883eb3d

Browse files
committed
'template' array key may not be set.
1 parent d267a90 commit 883eb3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/my-calendar-widgets.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ function my_calendar_upcoming_events( $args ) {
6767
$args['before'] = ( 'default' === $args['before'] ) ? $defaults['upcoming']['before'] : $args['before'];
6868
$args['before'] = ( '' === $args['before'] ) ? 0 : $args['before'];
6969
$category = ( 'default' === $category ) ? '' : $category;
70+
$template = ( isset( $args['template'] ) ) ? $args['template'] : '';
7071

7172
/**
7273
* Pass a custom template to the upcoming events list. Template can either be a template key referencing a stored template or a template pattern using {} template tags.
@@ -77,7 +78,7 @@ function my_calendar_upcoming_events( $args ) {
7778
*
7879
* @return {string} Template string.
7980
*/
80-
$args['template'] = apply_filters( 'mc_upcoming_events_template', $args['template'] );
81+
$args['template'] = apply_filters( 'mc_upcoming_events_template', $template );
8182
$default = ( ! $args['template'] || 'default' === $args['template'] ) ? $defaults['upcoming']['template'] : $args['template'];
8283
$args['template'] = mc_setup_template( $args['template'], $default );
8384

0 commit comments

Comments
 (0)