From 495a0134767c49faaada5f0d2ca4dbd402103eb2 Mon Sep 17 00:00:00 2001 From: Eduardo Trujillo Date: Fri, 21 Oct 2016 11:54:17 -0700 Subject: [PATCH] fix(widget): Display default title if its empty --- src/views/snagshout-widget.php | 5 ++++- src/widget/snagshout-widget-class.php | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/snagshout-widget.php b/src/views/snagshout-widget.php index d2a3611..e858418 100644 --- a/src/views/snagshout-widget.php +++ b/src/views/snagshout-widget.php @@ -3,7 +3,10 @@ if (!$hide_title) { echo $before_title; - echo apply_filters('widget_title', $title); + echo apply_filters( + 'widget_title', + $title ? $title : 'Featured Coupon Codes' + ); echo $after_title; } diff --git a/src/widget/snagshout-widget-class.php b/src/widget/snagshout-widget-class.php index f318926..bc40181 100644 --- a/src/widget/snagshout-widget-class.php +++ b/src/widget/snagshout-widget-class.php @@ -36,6 +36,7 @@ function widget($args, $instance) { [ 'title' => 'Featured Coupon Codes', 'response' => $response, + 'hide_title' => false, ], $args, $instance