PluginProbe
Import WP – CSV & XML Import Export for WordPress / trunk
Import WP – CSV & XML Import Export for WordPress vtrunk
2.14.24 2.14.23 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.9.0 2.9.1 trunk 0.1.6 All 142 releases
jc-importer / class / Common / AddonAPI / Importer / Template / Panel.php

Panel.php in Import WP – CSV & XML Import Export for WordPress trunk, at class/Common/AddonAPI/Importer/Template/Panel.php

49 lines 825 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ImportWP\Common\AddonAPI\Importer\Template;
4
5 class Panel extends Group
6 {
7 private $_id;
8 private $_name;
9 private $_repeater = false;
10
11 public function __construct($name, $args = [])
12 {
13 $this->_id = $args['id'] ?? sanitize_title($name);
14 $this->_name = $name;
15 }
16
17 public function get_id()
18 {
19 return $this->_id;
20 }
21
22 public function get_name()
23 {
24 return $this->_name;
25 }
26
27 public function get_args()
28 {
29 $args = [];
30
31 if ($this->is_repeater()) {
32 $args['type'] = 'repeatable';
33 }
34
35 return $args;
36 }
37
38 public function repeater($bool = true)
39 {
40 $this->_repeater = $bool;
41 return $this;
42 }
43
44 public function is_repeater()
45 {
46 return $this->_repeater;
47 }
48 }
49