PluginProbe
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment / 2.1.4
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment v2.1.4
3.1.14 3.1.13 3.1.12 3.1.11 3.1.10 3.1.9 3.1.8 3.1.7 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 All 123 releases
← All changes | Inc/Core/Form/Fields/Field.php +7 -42 3.1.7 → 2.1.4 View file →
@@ -1,12 +1,12 @@
1 1 <?php
2 2 /**
3 3 * @package FireBox
4 - * @version 3.1.7 Free
4 + * @version 2.1.4 Free
5 5 *
6 6 * @author FirePlugins <[email protected]>
7 7 * @link https://www.fireplugins.com
8 - * @copyright Copyright © 2026 FirePlugins All Rights Reserved
8 + * @copyright Copyright © 2024 FirePlugins All Rights Reserved
9 9 * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
10 10 */
11 11
12 12 namespace FireBox\Core\Form\Fields;
@@ -31,16 +31,9 @@
31 31 * @var string
32 32 */
33 33 protected $validation_message = '';
34 34
35 - /**
36 - * The form data.
37 - *
38 - * @var array
39 - */
40 - protected $data = [];
41 -
42 - public function __construct($options = [], $data = [])
35 + public function __construct($options = [])
43 36 {
44 37 // Merge default options with given options
45 38 $this->options = array_merge($this->getDefaultOptions(), $options);
46 39
@@ -45,10 +38,8 @@
45 38 $this->options = array_merge($this->getDefaultOptions(), $options);
46 39
47 40 // Then merge new options with each field options
48 41 $this->options = array_merge($this->options, $this->getFieldOptions());
49 -
50 - $this->data = $data;
51 42 }
52 43
53 44 protected function getFieldOptions()
54 45 {
@@ -56,13 +47,8 @@
56 47 'required' => isset($this->options['required']) ? $this->options['required'] : true
57 48 ];
58 49 }
59 50
60 - public function getType()
61 - {
62 - return $this->type;
63 - }
64 -
65 51 /**
66 52 * Returns the default field options.
67 53 *
68 54 * @return array
@@ -122,14 +108,8 @@
122 108 {
123 109 return implode(', ', $value);
124 110 }
125 111
126 - // Check if the value is a JSON string
127 - if (is_string($value) && ($json = json_decode($value, true)) && is_array($json))
128 - {
129 - return implode(', ', $json);
130 - }
131 -
132 112 // Strings and numbers
133 113 return \FireBox\Core\Helpers\Form\Field::escape($value);
134 114 }
135 115
@@ -142,13 +122,8 @@
142 122 {
143 123 return $this->prepareValue($value);
144 124 }
145 125
146 - public function prepareRawValue($value)
147 - {
148 - return $value;
149 - }
150 -
151 126 public function getValueRaw()
152 127 {
153 128 return $this->getValue();
154 129 }
@@ -174,9 +149,9 @@
174 149 }
175 150
176 151 public function setOptionValue($key = '', $value = '')
177 152 {
178 - if (!$key)
153 + if (!$key || !$value)
179 154 {
180 155 return;
181 156 }
182 157
@@ -182,31 +157,21 @@
182 157
183 158 $this->options[$key] = $value;
184 159 }
185 160
186 - public function getOptionValue($key = '', $default = '')
161 + public function getOptionValue($key = '')
187 162 {
188 163 if (!$key)
189 164 {
190 - return $default;
165 + return;
191 166 }
192 167
193 - return isset($this->options[$key]) ? $this->options[$key] : $default;
168 + return isset($this->options[$key]) ? $this->options[$key] : '';
194 169 }
195 170
196 171 public function addInputCSSClass($css = '')
197 172 {
198 173 $this->options['input_css_class'][] = $css;
199 - }
200 -
201 - public function setData($data = [])
202 - {
203 - $this->data = $data;
204 - }
205 -
206 - public function getData()
207 - {
208 - return $this->Form;
209 174 }
210 175
211 176 /**
212 177 * Return the field label.