adding check for option fields in the options before trying to displaay them. adding...
authorAnthony Talarico <talarico@gaslightmedia.com>
Sun, 20 Oct 2019 17:34:46 +0000 (13:34 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Sun, 20 Oct 2019 17:34:46 +0000 (13:34 -0400)
controllers/Admin.php
views/text.php

index 1027108..8e0bb7a 100644 (file)
@@ -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(
index a00fba9..2287ccf 100644 (file)
@@ -1,2 +1,6 @@
+
+<?php 
+$option_value = isset($options[$fieldName]) ? $options[$fieldName] : '';
+?>
 <input type="text" name="glmclientinfo_settings[<?php echo $fieldName;?>]"
-           value="<?php echo str_replace('"', '&quote;', $options[$fieldName]); ?>">
\ No newline at end of file
+           value="<?php echo str_replace('"', '&quote;', $option_value); ?>">
\ No newline at end of file