From f2ce1b68cec39bf3ac4122c3e4edfd3768d794a3 Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Sun, 5 Jan 2020 13:06:28 +0200 Subject: [PATCH] Leaner arg construction --- src/WidgetContext.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/WidgetContext.php b/src/WidgetContext.php index 62e46da..9282a00 100644 --- a/src/WidgetContext.php +++ b/src/WidgetContext.php @@ -307,10 +307,10 @@ function check_widget_visibility( $widget_id ) { continue; } + $widget_context_args = array(); + // Make sure that context settings for this widget are defined - if ( ! isset( $this->context_options[ $widget_id ][ $context_id ] ) ) { - $widget_context_args = array(); - } else { + if ( ! empty( $this->context_options[ $widget_id ][ $context_id ] ) ) { $widget_context_args = $this->context_options[ $widget_id ][ $context_id ]; }