Total Complexity | 1 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php namespace EmailLog\Core\UI\Setting; |
||
12 | class SettingSection { |
||
13 | |||
14 | public $id; |
||
15 | public $title; |
||
16 | public $callback; |
||
17 | |||
18 | /** |
||
19 | * Each section will have a single option name and the value will be array. |
||
20 | * All individual fields will be stored as an element in the value array. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | public $option_name; |
||
25 | |||
26 | /** |
||
27 | * Sanitize callback for the setting. |
||
28 | * An array will be passed to this callback. |
||
29 | * |
||
30 | * @var callable |
||
31 | */ |
||
32 | public $sanitize_callback; |
||
33 | |||
34 | /** |
||
35 | * List of fields for this section. |
||
36 | * |
||
37 | * @var SettingField[] |
||
38 | */ |
||
39 | public $fields = array(); |
||
40 | |||
41 | /** |
||
42 | * Default value of the fields. |
||
43 | * |
||
44 | * @var array |
||
45 | * |
||
46 | * @since 2.1.0 |
||
47 | */ |
||
48 | public $default_value = array(); |
||
49 | |||
50 | /** |
||
51 | * Field labels. |
||
52 | * |
||
53 | * @var array |
||
54 | * |
||
55 | * @since 2.1.0 |
||
56 | */ |
||
57 | public $field_labels = array(); |
||
58 | |||
59 | /** |
||
60 | * Add a field to the section. |
||
61 | * |
||
62 | * @param \EmailLog\Core\UI\Setting\SettingField $field Field to add. |
||
63 | */ |
||
64 | public function add_field( SettingField $field ) { |
||
68 |