PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.17.0
GiveWP – Donation Plugin and Fundraising Platform v2.17.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 in GiveWP – Donation Plugin and Fundraising Platform 2.17.0, at src/FormAPI/Form/Radio.php

45 lines 716 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Give\FormAPI\Form;
3
4 class Radio extends Field {
5 /**
6 * Field options.
7 *
8 * @sicne 2.7.0
9 * @var array
10 */
11 public $options = [];
12
13 /**
14 * Field display style.
15 *
16 * @since 2.7.0
17 * @var string
18 */
19 public $displayStyle = '';
20
21 /**
22 * @inheritDoc
23 */
24 public function parse( $array ) {
25 parent::parse( $array );
26
27 $this->options = isset( $array['options'] ) ? $array['options'] : [];
28
29 $type = explode( '_', $this->type, 2 );
30 $this->displayStyle = false !== strpos( '_', $this->type ) ? array_pop( $type ) : '';
31 }
32
33 /**
34 * @inheritDoc
35 */
36 public function toArray() {
37 return array_merge(
38 parent::toArray(),
39 [
40 'options' => $this->options,
41 ]
42 );
43 }
44 }
45