1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| <?php
| namespace JVBase\registrar\fields;
|
|
| if (!defined('ABSPATH')) {
| exit;
| }
|
| class GroupedField extends Field {
| protected array $fields;
|
| public function setFields(array $fields):void
| {
| foreach ($fields as $name => $config) {
| $this->fields[$name] = match ($config['type']) {
| 'upload', 'image', 'gallery' => new Upload($name, $config),
| 'checkbox', 'radio', 'select', 'set' => new OptionsField($name, $config),
| 'repeater', 'group', 'tagList' => new GroupedField($name, $config),
| 'selector', 'taxonomy', 'user', 'post' => new TaxonomyField($name, $config),
| default => new Field($name, $config),
| };
| }
| }
| }
|
|