PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / 1.4.6
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel v1.4.6
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / classes / wpallimport.php
wp-all-export / classes Last commit date
CdataStrategy.php 8 years ago CdataStrategyAlways.php 8 years ago CdataStrategyFactory.php 9 years ago CdataStrategyIllegalCharacters.php 2 years ago CdataStrategyIllegalCharactersHtmlEntities.php 8 years ago CdataStrategyNever.php 8 years ago XMLWriter.php 2 years ago chunk.php 2 years ago config.php 3 years ago download.php 6 years ago handler.php 10 years ago helper.php 4 years ago input.php 7 years ago installer.php 4 years ago session.php 10 years ago wpallimport.php 4 years ago zip.php 4 years ago
wpallimport.php
611 lines
1 <?php
2
3 final class PMXE_Wpallimport
4 {
5 /**
6 * Singletone instance
7 * @var PMXE_Wpallimport
8 */
9 protected static $instance;
10
11 /**
12 * Return singletone instance
13 * @return PMXE_Wpallimport
14 */
15 static public function getInstance() {
16 if (self::$instance == NULL) {
17 self::$instance = new self();
18 }
19 return self::$instance;
20 }
21
22 private function __construct(){}
23
24 public static function create_an_import( & $export )
25 {
26
27 $custom_type = (empty($export->options['cpt'])) ? 'post' : $export->options['cpt'][0];
28
29 // Do not create an import for WooCommerce Orders & Refunds
30 // if ( in_array($custom_type, array('shop_order'))) return false;
31
32 if ( $export->options['is_generate_import'] and wp_all_export_is_compatible() ){
33
34 $import = new PMXI_Import_Record();
35
36 if ( ! empty($export->options['import_id']) ) $import->getById($export->options['import_id']);
37
38 if ($import->isEmpty())
39 {
40 $import->set(array(
41 'parent_import_id' => 99999,
42 'xpath' => '/',
43 'type' => 'upload',
44 'options' => array('empty'),
45 'root_element' => 'root',
46 'path' => 'path',
47 'imported' => 0,
48 'created' => 0,
49 'updated' => 0,
50 'skipped' => 0,
51 'deleted' => 0,
52 'iteration' => 1
53 ))->save();
54
55 if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
56 {
57 PMXE_Plugin::$session->set('import_id', $import->id);
58 }
59 $options = $export->options;
60 $options['import_id'] = $import->id;
61
62 $export->set(array(
63 'options' => $options
64 ))->save();
65 }
66 else
67 {
68 if ( $import->parent_import_id != 99999 )
69 {
70 $newImport = new PMXI_Import_Record();
71
72 $newImport->set(array(
73 'parent_import_id' => 99999,
74 'xpath' => '/',
75 'type' => 'upload',
76 'options' => array('empty'),
77 'root_element' => 'root',
78 'path' => 'path',
79 'imported' => 0,
80 'created' => 0,
81 'updated' => 0,
82 'skipped' => 0,
83 'deleted' => 0,
84 'iteration' => 1
85 ))->save();
86
87 if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
88 {
89 PMXE_Plugin::$session->set('import_id', $newImport->id);
90 }
91
92 $options = $export->options;
93 $options['import_id'] = $newImport->id;
94
95 $export->set(array(
96 'options' => $options
97 ))->save();
98 }
99 else
100 {
101 global $wpdb;
102 $post = new PMXI_Post_List();
103 $wpdb->query($wpdb->prepare('DELETE FROM ' . $post->getTable() . ' WHERE import_id = %s', $import->id));
104 }
105 }
106 }
107 }
108
109 public static $templateOptions = array();
110 public static function generateImportTemplate( & $export, $file_path = '', $foundPosts = 0, $link_to_import = true )
111 {
112 $exportOptions = $export->options;
113
114 $custom_type = (empty($exportOptions['cpt'])) ? 'post' : $exportOptions['cpt'][0];
115
116 if(XmlExportEngine::$is_custom_addon_export) {
117 $custom_type = 'gf_entries';
118 }
119
120 // Do not create an import template for WooCommerce Refunds
121 if ( $export->options['export_to'] == 'xml' && in_array($export->options['xml_template_type'], array('custom', 'XmlGoogleMerchants')) ) return false;
122
123 // Generate template for WP All Import
124 if ($exportOptions['is_generate_templates'])
125 {
126 self::$templateOptions = array(
127 'type' => ( ! empty($exportOptions['cpt']) and $exportOptions['cpt'][0] == 'page') ? 'page' : 'post',
128 'wizard_type' => 'new',
129 'deligate' => 'wpallexport',
130 'custom_type' => (XmlExportEngine::$is_user_export) ? 'import_users' : $custom_type,
131 'status' => 'xpath',
132 'is_multiple_page_parent' => 'no',
133 'unique_key' => '',
134 'acf' => array(),
135 'fields' => array(),
136 'is_multiple_field_value' => array(),
137 'multiple_value' => array(),
138 'fields_delimiter' => array(),
139 'update_all_data' => 'no',
140 'is_update_status' => 0,
141 'is_update_title' => 0,
142 'is_update_author' => 0,
143 'is_update_slug' => 0,
144 'is_update_content' => 0,
145 'is_update_excerpt' => 0,
146 'is_update_dates' => 0,
147 'is_update_menu_order' => 0,
148 'is_update_parent' => 0,
149 'is_update_attachments' => 0,
150 'is_update_acf' => 0,
151 'is_update_comment_status' => 0,
152 'import_img_tags' => 1,
153 'update_acf_logic' => 'only',
154 'acf_list' => '',
155 'is_update_product_type' => 1,
156 'is_update_attributes' => 0,
157 'update_attributes_logic' => 'only',
158 'attributes_list' => '',
159 'is_update_images' => 0,
160 'is_update_custom_fields' => 0,
161 'update_custom_fields_logic' => 'only',
162 'custom_fields_list' => '',
163 'is_update_categories' => 0,
164 'update_categories_logic' => 'only',
165 'taxonomies_list' => '',
166 'export_id' => $export->id
167 );
168
169
170 if(XmlExportEngine::$is_custom_addon_export) {
171
172 $gf_addon = \GF_Export_Add_On::get_instance();
173 $sub_post_type = $gf_addon->add_on->get_sub_post_type();
174
175 if(class_exists('GFAPI')) {
176 $form = GFAPI::get_form($sub_post_type);
177 self::$templateOptions['gravity_form_title'] = $form['title'];
178 }
179 }
180
181 if ( in_array('product', $exportOptions['cpt']) )
182 {
183 $default = array(
184 'is_multiple_product_type' => 'yes',
185 'multiple_product_type' => 'simple',
186 'is_product_virtual' => 'no',
187 'is_product_downloadable' => 'no',
188 'is_product_enabled' => 'yes',
189 'is_variation_enabled' => 'yes',
190 'is_product_featured' => 'no',
191 'is_product_visibility' => 'visible',
192 'is_multiple_product_tax_status' => 'yes',
193 'multiple_product_tax_status' => 'none',
194 'is_multiple_product_tax_class' => 'yes',
195 'is_product_manage_stock' => 'no',
196 'product_stock_status' => 'auto',
197 'product_allow_backorders' => 'no',
198 'product_sold_individually' => 'no',
199 'is_multiple_product_shipping_class' => 'yes',
200 'is_multiple_grouping_product' => 'yes',
201 'is_product_enable_reviews' => 'no',
202 'single_sale_price_dates_from' => 'now',
203 'single_sale_price_dates_to' => 'now',
204 'product_files_delim' => ',',
205 'product_files_names_delim' => ',',
206 'matching_parent' => 'auto',
207 'parent_indicator' => 'custom field',
208 'missing_records_stock_status' => 0,
209 'is_variable_sale_price_shedule' => 0,
210 'is_variable_product_virtual' => 'no',
211 'is_variable_product_manage_stock' => 'no',
212 'is_multiple_variable_product_shipping_class' => 'yes',
213 'is_multiple_variable_product_tax_class' => 'yes',
214 'multiple_variable_product_tax_class' => 'parent',
215 'variable_stock_status' => 'instock',
216 'variable_allow_backorders' => 'no',
217 'is_variable_product_downloadable' => 'no',
218 'variable_product_files_delim' => ',',
219 'variable_product_files_names_delim' => ',',
220 'is_variable_product_enabled' => 'yes',
221 'first_is_parent' => 'yes',
222 'default_attributes_type' => 'first',
223 'disable_sku_matching' => 1,
224 'disable_prepare_price' => 1,
225 'convert_decimal_separator' => 1,
226 'grouping_indicator' => 'xpath',
227 'is_update_product_type' => 1,
228 'make_simple_product' => 1,
229 'single_product_regular_price_adjust_type' => '%',
230 'single_product_sale_price_adjust_type' => '%',
231 'is_variation_product_manage_stock' => 'no',
232 'variation_stock_status' => 'auto',
233 );
234
235 self::$templateOptions = array_replace_recursive(self::$templateOptions, $default);
236
237 self::$templateOptions['_virtual'] = 1;
238 self::$templateOptions['_downloadable'] = 1;
239 self::$templateOptions['put_variation_image_to_gallery'] = 1;
240 self::$templateOptions['disable_auto_sku_generation'] = 1;
241 }
242
243 if ( in_array('shop_order', $exportOptions['cpt']) )
244 {
245 self::$templateOptions['update_all_data'] = 'no';
246 self::$templateOptions['is_update_status'] = 0;
247 self::$templateOptions['is_update_dates'] = 0;
248 self::$templateOptions['is_update_excerpt'] = 0;
249
250 // $default = PMWI_Plugin::get_default_import_options();
251 // self::$templateOptions['pmwi_order'] = $default['pmwi_order'];
252 self::$templateOptions['pmwi_order'] = array();
253 self::$templateOptions['pmwi_order']['is_update_billing_details'] = 0;
254 self::$templateOptions['pmwi_order']['is_update_shipping_details'] = 0;
255 self::$templateOptions['pmwi_order']['is_update_payment'] = 0;
256 self::$templateOptions['pmwi_order']['is_update_notes'] = 0;
257 self::$templateOptions['pmwi_order']['is_update_products'] = 0;
258 self::$templateOptions['pmwi_order']['is_update_fees'] = 0;
259 self::$templateOptions['pmwi_order']['is_update_coupons'] = 0;
260 self::$templateOptions['pmwi_order']['is_update_shipping'] = 0;
261 self::$templateOptions['pmwi_order']['is_update_taxes'] = 0;
262 self::$templateOptions['pmwi_order']['is_update_refunds'] = 0;
263 self::$templateOptions['pmwi_order']['is_update_total'] = 0;
264 self::$templateOptions['pmwi_order']['is_guest_matching'] = 1;
265 self::$templateOptions['pmwi_order']['status'] = 'wc-pending';
266 self::$templateOptions['pmwi_order']['billing_source'] = 'existing';
267 self::$templateOptions['pmwi_order']['billing_source_match_by'] = 'username';
268 self::$templateOptions['pmwi_order']['shipping_source'] = 'guest';
269 self::$templateOptions['pmwi_order']['copy_from_billing'] = 1;
270 self::$templateOptions['pmwi_order']['products_repeater_mode'] = 'csv';
271 self::$templateOptions['pmwi_order']['products_repeater_mode_separator'] = '|';
272 self::$templateOptions['pmwi_order']['products_source'] = 'existing';
273 self::$templateOptions['pmwi_order']['fees_repeater_mode'] = 'csv';
274 self::$templateOptions['pmwi_order']['fees_repeater_mode_separator'] = '|';
275 self::$templateOptions['pmwi_order']['coupons_repeater_mode'] = 'csv';
276 self::$templateOptions['pmwi_order']['coupons_repeater_mode_separator'] = '|';
277 self::$templateOptions['pmwi_order']['shipping_repeater_mode'] = 'csv';
278 self::$templateOptions['pmwi_order']['shipping_repeater_mode_separator'] = '|';
279 self::$templateOptions['pmwi_order']['taxes_repeater_mode'] = 'csv';
280 self::$templateOptions['pmwi_order']['taxes_repeater_mode_separator'] = '|';
281 self::$templateOptions['pmwi_order']['order_total_logic'] = 'auto';
282 self::$templateOptions['pmwi_order']['order_refund_date'] = 'now';
283 self::$templateOptions['pmwi_order']['order_refund_issued_source'] = 'existing';
284 self::$templateOptions['pmwi_order']['order_refund_issued_match_by'] = 'username';
285 self::$templateOptions['pmwi_order']['notes_repeater_mode'] = 'csv';
286 self::$templateOptions['pmwi_order']['notes_repeater_mode_separator'] = '|';
287 }
288
289 if ( XmlExportEngine::$is_user_export )
290 {
291 self::$templateOptions['is_update_first_name'] = 0;
292 self::$templateOptions['is_update_last_name'] = 0;
293 self::$templateOptions['is_update_role'] = 0;
294 self::$templateOptions['is_update_nickname'] = 0;
295 self::$templateOptions['is_update_description'] = 0;
296 self::$templateOptions['is_update_login'] = 0;
297 self::$templateOptions['is_update_password'] = 0;
298 self::$templateOptions['is_update_nicename'] = 0;
299 self::$templateOptions['is_update_email'] = 0;
300 self::$templateOptions['is_update_registered'] = 0;
301 self::$templateOptions['is_update_display_name'] = 0;
302 self::$templateOptions['is_update_url'] = 0;
303 }
304
305 if (XmlExportEngine::$is_taxonomy_export){
306 self::$templateOptions['taxonomy_type'] = $exportOptions['taxonomy_to_export'];
307 }
308
309 self::prepare_import_template( $exportOptions );
310
311 if ( in_array('product', $exportOptions['cpt']) )
312 {
313 self::$templateOptions['single_page_parent'] = '';
314 if ( ! empty($exportOptions['export_variations']) && $exportOptions['export_variations'] == XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_VARIATION ){
315 if ( $exportOptions['export_variations_title'] == XmlExportEngine::VARIATION_USE_PARENT_TITLE ){
316 self::$templateOptions['matching_parent'] = 'first_is_variation';
317 }
318 if ( $exportOptions['export_variations_title'] == XmlExportEngine::VARIATION_USE_DEFAULT_TITLE ) {
319 self::$templateOptions['matching_parent'] = 'first_is_parent_id';
320 }
321 self::$templateOptions['create_new_records'] = 0;
322 self::$templateOptions['is_update_product_type'] = 0;
323 }
324 }
325
326 $tpl_options = self::$templateOptions;
327
328 if ( 'csv' == $exportOptions['export_to'] )
329 {
330 $tpl_options['delimiter'] = $exportOptions['delimiter'];
331 $tpl_options['root_element'] = 'node';
332 }
333 else
334 {
335 $tpl_options['root_element'] = $exportOptions['record_xml_tag'];
336 }
337
338 $tpl_options['update_all_data'] = 'yes';
339 $tpl_options['is_update_status'] = 1;
340 $tpl_options['is_update_title'] = 1;
341 $tpl_options['is_update_author'] = 1;
342 $tpl_options['is_update_slug'] = 1;
343 $tpl_options['is_update_content'] = 1;
344 $tpl_options['is_update_excerpt'] = 1;
345 $tpl_options['is_update_dates'] = 1;
346 $tpl_options['is_update_menu_order'] = 1;
347 $tpl_options['is_update_parent'] = 1;
348 $tpl_options['is_update_attachments'] = 1;
349 $tpl_options['is_update_acf'] = 1;
350 $tpl_options['update_acf_logic'] = 'full_update';
351 $tpl_options['acf_list'] = '';
352 $tpl_options['is_update_product_type'] = 1;
353 $tpl_options['is_update_attributes'] = 1;
354 $tpl_options['update_attributes_logic'] = 'full_update';
355 $tpl_options['attributes_list'] = '';
356 $tpl_options['is_update_images'] = 1;
357 $tpl_options['is_update_custom_fields'] = 1;
358 $tpl_options['update_custom_fields_logic'] = 'full_update';
359 $tpl_options['custom_fields_list'] = '';
360 $tpl_options['is_update_categories'] = 1;
361 $tpl_options['update_categories_logic'] = 'full_update';
362 $tpl_options['taxonomies_list'] = '';
363
364 $tpl_data = array(
365 'name' => $exportOptions['template_name'],
366 'is_keep_linebreaks' => 1,
367 'is_leave_html' => 0,
368 'fix_characters' => 0,
369 'options' => $tpl_options,
370 );
371
372 $exportOptions['tpl_data'] = $tpl_data;
373
374 $export->set(array(
375 'options' => $exportOptions
376 ))->save();
377
378 }
379
380 $link_to_import and $export->options['is_generate_import'] and self::link_template_to_import( $export, $file_path, $foundPosts );
381 }
382
383 public static function link_template_to_import( & $export, $file_path, $foundPosts )
384 {
385
386 $exportOptions = $export->options;
387
388 // associate exported posts with new import
389 if ( wp_all_export_is_compatible() )
390 {
391 $options = self::$templateOptions + PMXI_Plugin::get_default_import_options();
392
393 $import = new PMXI_Import_Record();
394
395 $import->getById($exportOptions['import_id']);
396
397 if ( ! $import->isEmpty() and $import->parent_import_id == 99999 ){
398
399 $xmlPath = $file_path;
400
401 $root_element = '';
402
403 $historyPath = $file_path;
404
405 if ( 'csv' == $exportOptions['export_to'] )
406 {
407 $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
408
409 $options['delimiter'] = $exportOptions['delimiter'];
410
411 include_once( PMXI_Plugin::ROOT_DIR . '/libraries/XmlImportCsvParse.php' );
412
413 $path_info = pathinfo($xmlPath);
414
415 $path_parts = explode(DIRECTORY_SEPARATOR, $path_info['dirname']);
416
417 $security_folder = array_pop($path_parts);
418
419 $wp_uploads = wp_upload_dir();
420
421 $target = $is_secure_import ? $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::UPLOADS_DIRECTORY . DIRECTORY_SEPARATOR . $security_folder : $wp_uploads['path'];
422
423 $csv = new PMXI_CsvParser( array( 'filename' => $xmlPath, 'targetDir' => $target ) );
424
425 if ( ! in_array($xmlPath, $exportOptions['attachment_list']) )
426 {
427 $exportOptions['attachment_list'][] = $csv->xml_path;
428 }
429
430 $historyPath = $csv->xml_path;
431
432 $root_element = 'node';
433
434 }
435 else
436 {
437 $root_element = apply_filters('wp_all_export_record_xml_tag', $exportOptions['record_xml_tag'], $export->id);
438 }
439
440 $import->set(array(
441 'xpath' => '/' . $root_element,
442 'type' => 'upload',
443 'options' => $options,
444 'root_element' => $root_element,
445 'path' => $xmlPath,
446 'name' => basename($xmlPath),
447 'imported' => 0,
448 'created' => 0,
449 'updated' => 0,
450 'skipped' => 0,
451 'deleted' => 0,
452 'iteration' => 1,
453 'count' => $foundPosts
454 ))->save();
455
456 $history_file = new PMXI_File_Record();
457 $history_file->set(array(
458 'name' => $import->name,
459 'import_id' => $import->id,
460 'path' => $historyPath,
461 'registered_on' => date('Y-m-d H:i:s')
462 ))->save();
463
464 $exportOptions['import_id'] = $import->id;
465
466 $export->set(array(
467 'options' => $exportOptions
468 ))->save();
469 }
470 }
471 }
472
473 public static function prepare_import_template( $exportOptions )
474 {
475 $options = $exportOptions;
476
477 $is_xml_template = $options['export_to'] == 'xml';
478
479 $required_add_ons = array();
480
481 $cf_list = array();
482 $attr_list = array();
483 $taxs_list = array();
484 $acf_list = array();
485
486 $implode_delimiter = ($options['delimiter'] == ',') ? '|' : ',';
487
488 $addons = new \Wpae\App\Service\Addons\AddonService();
489
490 if ( ! empty($options['is_user_export']) ) self::$templateOptions['pmui']['import_users'] = 1;
491
492 foreach ($options['ids'] as $ID => $value)
493 {
494 if (empty($options['cc_type'][$ID])) continue;
495
496 if ($is_xml_template)
497 {
498 $element_name = (!empty($options['cc_name'][$ID])) ? str_replace(':', '_', preg_replace('/[^a-z0-9_:-]/i', '', $options['cc_name'][$ID])) : 'untitled_' . $ID;
499 }
500 else
501 {
502 $element_name = strtolower((!empty($options['cc_name'][$ID])) ? preg_replace('/[^a-z0-9_]/i', '', $options['cc_name'][$ID]) : 'untitled_' . $ID);
503 }
504
505 if (empty($element_name)) $element_name = 'undefined' . $ID;
506
507 $element_type = $options['cc_type'][$ID];
508
509 switch ($element_type)
510 {
511 case 'woo':
512
513 if ( ! empty($options['cc_value'][$ID]) )
514 {
515 if (empty($required_add_ons['PMWI_Plugin']))
516 {
517 $required_add_ons['PMWI_Plugin'] = array(
518 'name' => 'WooCommerce Add-On Pro',
519 'paid' => true,
520 'url' => 'http://www.wpallimport.com/woocommerce-product-import/?utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=import-wooco-products-template'
521 );
522 }
523
524 if($addons->isWooCommerceAddonActive() || $addons->isWooCommerceProductAddonActive()) {
525 XmlExportWooCommerce::prepare_import_template( $options, self::$templateOptions, $cf_list, $attr_list, $element_name, $options['cc_label'][$ID] );
526 }
527 }
528
529 break;
530
531 case 'acf':
532
533 if($addons->isAcfAddonActive()) {
534
535 if (empty($required_add_ons['PMAI_Plugin']))
536 {
537 $required_add_ons['PMAI_Plugin'] = array(
538 'name' => 'ACF Add-On Pro',
539 'paid' => true,
540 'url' => 'http://www.wpallimport.com/advanced-custom-fields/?utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=import-acf-template'
541 );
542 }
543
544 $field_options = unserialize($options['cc_options'][$ID]);
545
546 // add ACF group ID to the template options
547 if( ! in_array($field_options['group_id'], self::$templateOptions['acf'])){
548 self::$templateOptions['acf'][$field_options['group_id']] = 1;
549 }
550
551 self::$templateOptions['fields'][$field_options['key']] = XmlExportACF::prepare_import_template( $options, self::$templateOptions, $acf_list, $element_name, $field_options);
552
553 }
554
555 break;
556
557 default:
558
559 XmlExportCpt::prepare_import_template( $options, self::$templateOptions, $cf_list, $attr_list, $taxs_list, $element_name, $ID);
560
561 XmlExportMediaGallery::prepare_import_template( $options, self::$templateOptions, $element_name, $ID);
562
563 if(XmlExportEngine::$is_custom_addon_export) {
564 XmlExportCustomRecord::prepare_import_template($options, self::$templateOptions, $element_name, $ID);
565 }
566
567 if($addons->isUserAddonActive()) {
568 XmlExportUser::prepare_import_template($options, self::$templateOptions, $element_name, $ID);
569 }
570
571 XmlExportTaxonomy::prepare_import_template( $options, self::$templateOptions, $element_name, $ID);
572
573 if($addons->isWooCommerceAddonActive() || $addons->isWooCommerceOrderAddonActive()) {
574 XmlExportWooCommerceOrder::prepare_import_template( $options, self::$templateOptions, $element_name, $ID);
575 }
576
577 break;
578 }
579 }
580
581 if ( ! empty($cf_list) )
582 {
583 self::$templateOptions['is_update_custom_fields'] = 1;
584 self::$templateOptions['custom_fields_list'] = $cf_list;
585 }
586 if ( ! empty($attr_list) )
587 {
588 self::$templateOptions['is_update_attributes'] = 1;
589 self::$templateOptions['update_attributes_logic'] = 'only';
590 self::$templateOptions['attributes_list'] = $attr_list;
591 self::$templateOptions['attributes_only_list'] = implode(',', $attr_list);
592 }
593 else{
594 self::$templateOptions['is_update_attributes'] = 0;
595 }
596 if ( ! empty($taxs_list) )
597 {
598 self::$templateOptions['is_update_categories'] = 1;
599 self::$templateOptions['taxonomies_list'] = $taxs_list;
600 }
601 if ( ! empty($acf_list) )
602 {
603 self::$templateOptions['is_update_acf'] = 1;
604 self::$templateOptions['acf_list'] = $acf_list;
605 }
606
607 self::$templateOptions['required_add_ons'] = $required_add_ons;
608 }
609 }
610
611 PMXE_Wpallimport::getInstance();