From c6cbd414d93c0f3fea0c2744f5f4dd3aa36c4720 Mon Sep 17 00:00:00 2001 From: savvasha Date: Sun, 19 May 2019 19:52:37 +0300 Subject: [PATCH] Add an extra Status option at Event List widget (Published+Scheduled) --- includes/sp-core-functions.php | 3 ++- templates/event-list.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/sp-core-functions.php b/includes/sp-core-functions.php index e1649e9c..21c6a6f7 100644 --- a/includes/sp-core-functions.php +++ b/includes/sp-core-functions.php @@ -653,7 +653,8 @@ if ( !function_exists( 'sp_dropdown_statuses' ) ) { $statuses = apply_filters( 'sportspress_statuses', array( 'any' => __( 'All', 'sportspress' ), 'publish' => __( 'Published', 'sportspress' ), - 'future' => __( 'Scheduled', 'sportspress' ) + 'future' => __( 'Scheduled', 'sportspress' ), + 'publish,future' => __( 'Published + Scheduled', 'sportspress' ) )); foreach ( $statuses as $value => $label ): diff --git a/templates/event-list.php b/templates/event-list.php index 8a70ea72..75595cd8 100644 --- a/templates/event-list.php +++ b/templates/event-list.php @@ -49,7 +49,8 @@ $defaults = array( extract( $defaults, EXTR_SKIP ); $calendar = new SP_Calendar( $id ); -if ( $status != 'default' ) +$status = explode ( ',', $status ); +if ( $status[0] != 'default' ) $calendar->status = $status; if ( $format != 'default' ) $calendar->event_format = $format;