PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.1.0
GiveWP – Donation Plugin and Fundraising Platform v4.1.0
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / FormAPI / Form / Radio.php
Radio.php
49 lines 846 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\FormAPI\Form;
4
5 class Radio extends Field
6 {
7 /**
8 * Field options.
9 *
10 * @sicne 2.7.0
11 * @var array
12 */
13 public $options = [];
14
15 /**
16 * Field display style.
17 *
18 * @since 2.7.0
19 * @var string
20 */
21 public $displayStyle = '';
22
23 /**
24 * @inheritDoc
25 */
26 public function parse($array)
27 {
28 parent::parse($array);
29
30 $this->options = isset($array['options']) ? $array['options'] : [];
31
32 $type = explode('_', $this->type, 2);
33 $this->displayStyle = false !== strpos('_', $this->type) ? array_pop($type) : '';
34 }
35
36 /**
37 * @inheritDoc
38 */
39 public function toArray()
40 {
41 return array_merge(
42 parent::toArray(),
43 [
44 'options' => $this->options,
45 ]
46 );
47 }
48 }
49