PluginProbe
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment / 2.1.23
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment v2.1.23
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 -39 trunk → 2.1.23 View file →
@@ -1,12 +1,12 @@
1 1 <?php
2 2 /**
3 3 * @package FireBox
4 - * @version 3.1.14 Free
4 + * @version 2.1.23 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;
@@ -18,17 +18,10 @@
18 18
19 19 class Field
20 20 {
21 21 /**
22 - * Field type. Set by subclasses.
23 - *
24 - * @var string
25 - */
26 - protected $type = '';
27 -
28 - /**
29 22 * Field options.
30 - *
23 + *
31 24 * @var array
32 25 */
33 26 protected $options = [];
34 27
@@ -38,16 +31,9 @@
38 31 * @var string
39 32 */
40 33 protected $validation_message = '';
41 34
42 - /**
43 - * The form data.
44 - *
45 - * @var array
46 - */
47 - protected $data = [];
48 -
49 - public function __construct($options = [], $data = [])
35 + public function __construct($options = [])
50 36 {
51 37 // Merge default options with given options
52 38 $this->options = array_merge($this->getDefaultOptions(), $options);
53 39
@@ -52,10 +38,8 @@
52 38 $this->options = array_merge($this->getDefaultOptions(), $options);
53 39
54 40 // Then merge new options with each field options
55 41 $this->options = array_merge($this->options, $this->getFieldOptions());
56 -
57 - $this->data = $data;
58 42 }
59 43
60 44 protected function getFieldOptions()
61 45 {
@@ -86,10 +70,10 @@
86 70 /**
87 71 * Validate the field.
88 72 *
89 73 * @param mixed $value
90 - *
91 - * @return bool
74 + *
75 + * @return void
92 76 */
93 77 public function validate(&$value = '')
94 78 {
95 79 if ($this->isRequired() && empty($value))
@@ -126,17 +110,11 @@
126 110 }
127 111
128 112 if (is_array($value))
129 113 {
130 - return implode(', ', array_map('\FireBox\Core\Helpers\Form\Field::escape', $value));
114 + return implode(', ', $value);
131 115 }
132 116
133 - // Check if the value is a JSON string
134 - if (is_string($value) && ($json = json_decode($value, true)) && is_array($json))
135 - {
136 - return implode(', ', array_map('\FireBox\Core\Helpers\Form\Field::escape', $json));
137 - }
138 -
139 117 // Strings and numbers
140 118 return \FireBox\Core\Helpers\Form\Field::escape($value);
141 119 }
142 120
@@ -202,18 +180,8 @@
202 180
203 181 public function addInputCSSClass($css = '')
204 182 {
205 183 $this->options['input_css_class'][] = $css;
206 - }
207 -
208 - public function setData($data = [])
209 - {
210 - $this->data = $data;
211 - }
212 -
213 - public function getData()
214 - {
215 - return $this->data;
216 184 }
217 185
218 186 /**
219 187 * Return the field label.