PluginProbe
Import WP – CSV & XML Import Export for WordPress / 2.15.0
Import WP – CSV & XML Import Export for WordPress v2.15.0
2.15.1 2.15.0 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 All 144 releases
← All changes | class/Common/Addon/AddonBase.php +19 -0 2.8.02.15.0 View file →
@@ -6,8 +6,11 @@
6 6 use ImportWP\Common\Importer\Template\Template;
7 7 use ImportWP\Common\Model\ImporterModel;
8 8 use ImportWP\Container;
9 9
10 +/**
11 + * @deprecated 2.14.0
12 + */
10 13 class AddonBase implements AddonInterface
11 14 {
12 15 /**
13 16 * @var callable
@@ -140,8 +143,24 @@
140 143 }
141 144
142 145 $group_fields = $section->fields();
143 146 $group_fields = $this->_register_fields($group_fields, $template, $importer_model);
147 +
148 + add_filter('iwp/template/permission_fields', function ($permission_fields) use ($section) {
149 +
150 + $section_id = $section->get_id();
151 + $section_label = $section->data('name');
152 +
153 + if (!isset($permission_fields[$section_label])) {
154 + $permission_fields[$section_label] = [];
155 + }
156 +
157 + foreach ($section->fields() as $field) {
158 + $permission_fields[$section_label][$section_id . '.' . $field->get_id()] = $field->data('name');
159 + }
160 +
161 + return $permission_fields;
162 + });
144 163
145 164
146 165 $fields = array_merge($fields, [
147 166 $template->register_group($section_data['name'], $section_id, (array)$group_fields, $section->settings())