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 / Addon / AddonBaseContainer.php

AddonBaseContainer.php in Import WP – CSV & XML Import Export for WordPress trunk, at class/Common/Addon/AddonBaseContainer.php

57 lines 1.2 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\Addon;
4
5 /**
6 * @deprecated 2.14.0
7 */
8 class AddonBaseContainer extends AddonBaseData
9 {
10 public function register_field($field_name, $field_id, $settings = [])
11 {
12 $field = new AddonBaseField($this->addon(), [
13 'id' => $field_id,
14 'name' => $field_name,
15 'type' => 'field',
16 'settings' => $settings
17 ]);
18
19 $this->_data['fields'][] = $field;
20
21 return $field;
22 }
23
24
25
26 public function register_group($group_name, $group_id, $callback)
27 {
28 $group = new AddonBaseGroup($this->addon(), $group_id, [
29 'id' => $group_id,
30 'name' => $group_name,
31 ]);
32
33 call_user_func($callback, $group);
34
35 $this->_data['fields'][] = $group;
36
37 return $group;
38 }
39
40
41
42 public function register_attachment_fields($field_name, $field_id, $field_label = 'Location', $group_args = [])
43 {
44 $field = new AddonBaseField($this->addon(), [
45 'id' => $field_id,
46 'name' => $field_name,
47 'field_label' => $field_label,
48 'type' => 'attachment',
49 'settings' => $group_args
50 ]);
51
52 $this->_data['fields'][] = $field;
53
54 return $field;
55 }
56 }
57