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/Exporter/Mapper/AbstractMapper.php +20 -0 2.9.0 → 2.15.0 View file →
@@ -66,8 +66,14 @@
66 66
67 67 foreach ($group as $row) {
68 68
69 69 $left = $this->get_value($row['left']);
70 +
71 + // left should always be a string
72 + if (is_array($left)) {
73 + $left = implode(',', $left);
74 + }
75 +
70 76 $right = $row['right'];
71 77 $right_parts = array_map('trim', explode(',', $right));
72 78
73 79 switch ($row['condition']) {
@@ -190,6 +196,20 @@
190 196 }
191 197 }
192 198
193 199 return $custom_fields;
200 + }
201 +
202 + public function parse_fields($fields)
203 + {
204 + $fields['fields'] = isset($fields['fields']) ? array_values($fields['fields']) : [];
205 +
206 + if (isset($fields['children']) && !empty($fields['fields'])) {
207 +
208 + foreach ($fields['children'] as $child_id => $child_data) {
209 + $fields['children'][$child_id] = $this->parse_fields($child_data);
210 + }
211 + }
212 +
213 + return $fields;
194 214 }
195 215 }