From 724b5456b14e319b14b739ae6a1f9d5229822ff5 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Sun, 20 Oct 2019 13:34:46 -0400 Subject: [PATCH] adding check for option fields in the options before trying to displaay them. adding more social media fields --- controllers/Admin.php | 62 +++++++++++++++++++++++++++++++++++++++---- views/text.php | 6 ++++- 2 files changed, 62 insertions(+), 6 deletions(-) diff --git a/controllers/Admin.php b/controllers/Admin.php index 1027108..8e0bb7a 100644 --- a/controllers/Admin.php +++ b/controllers/Admin.php @@ -307,11 +307,6 @@ class Glmclientinfo_Admin_Controller 'label' => 'GPS Lon.', 'type' => 'text' ), - array( - 'name' => 'extra', - 'label' => 'Extra Content', - 'type' => 'textarea' - ), array( 'name' => 'facebook', 'label' => 'Facebook', @@ -337,7 +332,29 @@ class Glmclientinfo_Admin_Controller 'label' => 'Pinterest', 'type' => 'text' ), + array( + 'name' => 'tripadvisor', + 'label' => 'Trip Advisor', + 'type' => 'text' + ), + array( + 'name' => 'flickr', + 'label' => 'Flickr', + 'type' => 'text' + ), + array( + 'name' => 'extra', + 'label' => 'Extra Content', + 'type' => 'textarea' + ), ); + + // foreach($fieldNames as $index => $setting){ + // if( ! in_array( $setting['name'], get_option( GLM_CLIENTINFO_SETTINGS ) ) && get_option( GLM_CLIENTINFO_SETTINGS ) !== FALSE ){ + // update_option(GLM_CLIENTINFO_SETTINGS , $fieldNames); + // } + // } + $fieldNames2 = array( array( 'name' => 'address2', @@ -389,6 +406,41 @@ class Glmclientinfo_Admin_Controller 'label' => 'Secondary GPS Lon.', 'type' => 'text' ), + array( + 'name' => 'facebook', + 'label' => 'Facebook', + 'type' => 'text' + ), + array( + 'name' => 'twitter', + 'label' => 'Twitter', + 'type' => 'text' + ), + array( + 'name' => 'instagram', + 'label' => 'Instagram', + 'type' => 'text' + ), + array( + 'name' => 'youtube', + 'label' => 'Youtube', + 'type' => 'text' + ), + array( + 'name' => 'pinterest', + 'label' => 'Pinterest', + 'type' => 'text' + ), + array( + 'name' => 'tripadvisor', + 'label' => 'Trip Advisor', + 'type' => 'text' + ), + array( + 'name' => 'flickr', + 'label' => 'Flickr', + 'type' => 'text' + ), ); $this->glmclientinfoAddSettingTextField( diff --git a/views/text.php b/views/text.php index a00fba9..2287ccf 100644 --- a/views/text.php +++ b/views/text.php @@ -1,2 +1,6 @@ + + "> \ No newline at end of file + value=""> \ No newline at end of file -- 2.17.1