From f65b21035bcf4d70ed8fbf9e4a60227d46f93ec0 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 26 May 2016 08:54:08 -0400 Subject: [PATCH] added conditional to show message if no lists are found --- class-streamsendfeedaddon.php | 37 +++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/class-streamsendfeedaddon.php b/class-streamsendfeedaddon.php index 75adfc6..464726c 100644 --- a/class-streamsendfeedaddon.php +++ b/class-streamsendfeedaddon.php @@ -115,6 +115,34 @@ class GFStreamSendAddOn extends GFFeedAddOn } array_unshift($lists,array('label'=>'Select a List', 'value'=>'')); + if(!empty($lists)){ + $listArray = array( + 'label' => 'Lists', + 'type' => 'select', + 'name' => 'lists', + 'tooltip' => 'Select a list to add the contact', + 'choices' => $lists + ); + } else { + $listArray = array( + 'label' => 'Lists', + 'type' => 'text', + 'name' => 'noLists', + 'value' => 'No lists detected' + ); + } + ?> + + 'StreamSend Form Settings', @@ -127,14 +155,7 @@ class GFStreamSendAddOn extends GFFeedAddOn 'tooltip' => esc_html__( 'Just a name', 'StreamSend' ), 'class' => 'small', ), - array( - 'label' => 'Lists', - 'type' => 'select', - 'name' => 'lists', - 'tooltip' => 'Select a list to add the contact', - 'choices' => $lists - - ), + $listArray, array( 'label' => 'Enable Opt-In', 'type' => 'checkbox', -- 2.17.1