PluginProbe ʕ •ᴥ•ʔ
Weight Based Shipping Table Rate for WooCommerce – Flexible Shipping / 6.11.0
Weight Based Shipping Table Rate for WooCommerce – Flexible Shipping v6.11.0
6.12.1 6.12.0 6.11.0 6.10.0 6.9.1 6.9.0 6.8.1 6.8.0 6.7.4 6.7.3 6.7.2 6.7.0 4.21.7 4.22.0 4.22.1 4.23.0 4.23.1 4.23.2 4.23.3 4.24.0 4.24.1 4.24.10 4.24.11 4.24.12 4.24.13 4.24.14 4.24.15 4.24.16 4.24.17 4.24.18 4.24.19 4.24.2 4.24.4 4.24.6 4.24.7 4.24.8 4.24.9 4.25.0 4.25.1 4.25.2 4.25.4 4.25.5 4.25.6 4.25.7 4.25.8 4.3.0 4.3.1 4.4.0 4.4.1 4.5.0 4.5.1 4.6.0 4.6.1 4.7.0 4.7.1 4.7.2 4.8.0 4.8.1 4.8.3 4.8.4 4.8.5 4.9.0 5.0.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.0.9 5.1.0 5.1.1 5.1.2 5.1.3 5.2.0 5.3.0 5.3.1 5.3.3 5.3.4 5.3.5 6.0.0 6.1.0 6.1.1 6.1.2 6.2.0 6.2.1 6.2.2 6.2.3 6.2.4 6.3.0 trunk 6.4.0 1.4 6.4.1 1.4.1 6.4.2 1.5 6.4.3 1.6 6.4.5 1.6.1 6.5.0 1.6.2 6.5.1 1.7 6.5.2 1.8 6.5.3 1.9 6.5.4 1.9.1 6.5.5 1.9.10 6.5.6 1.9.11 6.5.7 1.9.12 6.5.8 1.9.2 6.6.0 1.9.3 6.6.1 1.9.4 6.6.2 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0 2.0.1 2.1 2.1.1 2.1.10 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.6 3.0.7 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.10.0 3.11.0 3.11.1 3.11.2 3.11.3 3.11.4 3.12.0 3.13.0 3.14.0 3.14.1 3.14.2 3.14.3 3.14.4 3.15.0 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.2.0 3.3.1 3.3.10 3.3.11 3.3.12 3.3.13 3.3.14 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.8.0 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.15 3.9.16 3.9.17 3.9.18 3.9.19 3.9.2 3.9.20 3.9.21 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.9 4.0.0 4.0.1 4.0.10 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.10.0 4.10.1 4.11.0 4.11.1 4.11.2 4.11.3 4.11.4 4.11.5 4.11.6 4.11.7 4.11.8 4.11.9 4.12.0 4.13.0 4.13.1 4.13.2 4.13.3 4.14.0 4.14.1 4.14.2 4.15.0 4.16.0 4.16.1 4.16.2 4.17.0 4.18.0 4.18.1 4.18.2 4.18.3 4.18.4 4.18.5 4.18.6 4.19.0 4.19.1 4.2.0 4.20.0 4.20.1 4.20.2 4.20.3 4.21.0 4.21.1 4.21.2 4.21.3 4.21.4 4.21.5
flexible-shipping / vendor_prefixed / wpdesk / wp-forms / src / Field / BasicField.php
flexible-shipping / vendor_prefixed / wpdesk / wp-forms / src / Field Last commit date
Traits 2 weeks ago BasicField.php 2 weeks ago ButtonField.php 2 weeks ago CheckboxField.php 2 weeks ago DateField.php 2 weeks ago DatePickerField.php 2 weeks ago Header.php 2 weeks ago HiddenField.php 2 weeks ago ImageInputField.php 2 weeks ago InputNumberField.php 2 weeks ago InputTextField.php 2 weeks ago MultipleInputTextField.php 2 weeks ago NoOnceField.php 2 weeks ago NoValueField.php 2 weeks ago Paragraph.php 2 weeks ago ProductSelect.php 2 weeks ago RadioField.php 2 weeks ago SelectField.php 2 weeks ago SubmitField.php 2 weeks ago TextAreaField.php 2 weeks ago TimepickerField.php 2 weeks ago WooSelect.php 2 weeks ago WyswigField.php 2 weeks ago
BasicField.php
284 lines
1 <?php
2
3 namespace FSVendor\WPDesk\Forms\Field;
4
5 use FSVendor\WPDesk\Forms\Field;
6 use FSVendor\WPDesk\Forms\Sanitizer\NoSanitize;
7 use FSVendor\WPDesk\Forms\Serializer;
8 use FSVendor\WPDesk\Forms\Serializer\NoSerialize;
9 use FSVendor\WPDesk\Forms\Validator\ChainValidator;
10 use FSVendor\WPDesk\Forms\Validator\RequiredValidator;
11 /**
12 * Base class for fields. Is responsible for settings all required field values and provides standard implementation for
13 * the field interface.
14 *
15 * @package WPDesk\Forms
16 */
17 abstract class BasicField implements Field
18 {
19 use Field\Traits\HtmlAttributes;
20 /** @var array[] */
21 protected $meta;
22 protected $default_value;
23 public function __construct()
24 {
25 $this->meta['class'] = [];
26 }
27 public function get_label()
28 {
29 return $this->meta['label'];
30 }
31 /**
32 * @param string $value
33 *
34 * @return $this
35 */
36 public function set_label($value)
37 {
38 $this->meta['label'] = $value;
39 return $this;
40 }
41 public function get_description_tip()
42 {
43 return $this->meta['description_tip'];
44 }
45 public function has_description_tip()
46 {
47 return isset($this->meta['description_tip']);
48 }
49 public function should_override_form_template()
50 {
51 return isset($this->attributes['overrite_template']) ? $this->attributes['overrite_template'] : \false;
52 }
53 public function get_description()
54 {
55 return $this->meta['description'];
56 }
57 public function has_label()
58 {
59 return isset($this->meta['label']);
60 }
61 public function has_description()
62 {
63 return isset($this->meta['description']);
64 }
65 public function set_description($value)
66 {
67 $this->meta['description'] = $value;
68 return $this;
69 }
70 public function set_description_tip($value)
71 {
72 $this->meta['description_tip'] = $value;
73 return $this;
74 }
75 /**
76 * @return array
77 *
78 * @deprecated not sure if needed. TODO: Check later.
79 */
80 public function get_type()
81 {
82 return $this->attributes['type'];
83 }
84 /**
85 * @param string $value
86 *
87 * @return $this
88 */
89 public function set_placeholder($value)
90 {
91 $this->meta['placeholder'] = $value;
92 return $this;
93 }
94 public function has_placeholder()
95 {
96 return isset($this->meta['placeholder']);
97 }
98 public function get_placeholder()
99 {
100 return $this->meta['placeholder'];
101 }
102 /**
103 * @param string $name
104 *
105 * @return $this
106 */
107 public function set_name($name)
108 {
109 $this->attributes['name'] = $name;
110 return $this;
111 }
112 public function get_meta_value($name)
113 {
114 return $this->meta[$name];
115 }
116 public function get_classes()
117 {
118 return implode(' ', $this->meta['class']);
119 }
120 public function has_classes()
121 {
122 return !empty($this->meta['class']);
123 }
124 public function has_data()
125 {
126 return !empty($this->meta['data']);
127 }
128 /**
129 * @return array
130 */
131 public function get_data()
132 {
133 return empty($this->meta['data']) ? [] : $this->meta['data'];
134 }
135 public function get_possible_values()
136 {
137 return isset($this->meta['possible_values']) ? $this->meta['possible_values'] : [];
138 }
139 public function get_id()
140 {
141 return isset($this->attributes['id']) ? $this->attributes['id'] : sanitize_title($this->get_name());
142 }
143 public function get_name()
144 {
145 return $this->attributes['name'];
146 }
147 public function is_multiple()
148 {
149 return isset($this->attributes['multiple']) ? $this->attributes['multiple'] : \false;
150 }
151 /**
152 * @return $this
153 */
154 public function set_disabled()
155 {
156 $this->attributes['disabled'] = \true;
157 return $this;
158 }
159 public function is_disabled()
160 {
161 return isset($this->attributes['disabled']) ? $this->attributes['disabled'] : \false;
162 }
163 /**
164 * @return $this
165 */
166 public function set_readonly()
167 {
168 $this->attributes['readonly'] = \true;
169 return $this;
170 }
171 public function is_readonly()
172 {
173 return isset($this->attributes['readonly']) ? $this->attributes['readonly'] : \false;
174 }
175 /**
176 * @return $this
177 */
178 public function set_required()
179 {
180 $this->meta['required'] = \true;
181 return $this;
182 }
183 /**
184 * @param string $class_name
185 *
186 * @return $this
187 */
188 public function add_class($class_name)
189 {
190 $this->meta['class'][$class_name] = $class_name;
191 return $this;
192 }
193 /**
194 * @param string $class_name
195 *
196 * @return $this
197 */
198 public function unset_class($class_name)
199 {
200 unset($this->meta['class'][$class_name]);
201 return $this;
202 }
203 /**
204 * @param string $data_name
205 * @param string $data_value
206 *
207 * @return $this
208 */
209 public function add_data($data_name, $data_value)
210 {
211 if (!isset($this->meta['data'])) {
212 $this->meta['data'] = [];
213 }
214 $this->meta['data'][$data_name] = $data_value;
215 return $this;
216 }
217 /**
218 * @param string $data_name
219 *
220 * @return $this
221 */
222 public function unset_data($data_name)
223 {
224 unset($this->meta['data'][$data_name]);
225 return $this;
226 }
227 public function is_meta_value_set($name)
228 {
229 return isset($this->meta[$name]);
230 }
231 public function is_class_set($name)
232 {
233 return isset($this->meta['class'][$name]);
234 }
235 public function get_default_value()
236 {
237 return $this->default_value;
238 }
239 /**
240 * @param string $value
241 *
242 * @return $this
243 */
244 public function set_default_value($value)
245 {
246 $this->default_value = $value;
247 return $this;
248 }
249 /**
250 * @return ChainValidator
251 */
252 public function get_validator()
253 {
254 $chain = new ChainValidator();
255 if ($this->is_required()) {
256 $chain->attach(new RequiredValidator());
257 }
258 return $chain;
259 }
260 public function is_required()
261 {
262 return isset($this->meta['required']) ? $this->meta['required'] : \false;
263 }
264 public function get_sanitizer()
265 {
266 return new NoSanitize();
267 }
268 /**
269 * @return Serializer
270 */
271 public function get_serializer()
272 {
273 if (isset($this->meta['serializer']) && $this->meta['serializer'] instanceof Serializer) {
274 return $this->meta['serializer'];
275 }
276 return new NoSerialize();
277 }
278 public function set_serializer(Serializer $serializer)
279 {
280 $this->meta['serializer'] = $serializer;
281 return $this;
282 }
283 }
284