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 / Template.php

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

62 lines 1.1 KB
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 Template extends Group
6 {
7 /**
8 * @var Panel[]
9 */
10 private $_panels = [];
11
12 /**
13 * @var CustomFields[]
14 */
15 private $_custom_fields = [];
16
17 public function register_panel($name, $args = [])
18 {
19 $panel = new Panel($name, $args);
20 $this->_panels[] = $panel;
21 return $panel;
22 }
23
24 public function get_panel_ids()
25 {
26 $output = [];
27 foreach ($this->_panels as $panel) {
28 $output[] = $panel->get_id();
29 }
30
31 return $output;
32 }
33
34 public function get_panels()
35 {
36 return $this->_panels;
37 }
38
39 public function get_panel($panel_id)
40 {
41 foreach ($this->_panels as $panel) {
42 if ($panel->get_id() == $panel_id) {
43 return $panel;
44 }
45 }
46
47 return false;
48 }
49
50 public function register_custom_fields($name, $prefix)
51 {
52 $tmp = new CustomFields($name, $prefix);
53 $this->_custom_fields[] = $tmp;
54 return $tmp;
55 }
56
57 public function get_custom_fields()
58 {
59 return $this->_custom_fields;
60 }
61 }
62