PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / 1.3.1
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel v1.3.1
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 / helpers / wp_all_export_prepare_template_csv.php
wp-all-export / helpers Last commit date
backward.php 12 years ago get_taxonomies_by_object_type.php 10 years ago pmxe_filter.php 8 years ago pmxe_functions.php 5 years ago pmxe_prepare_price.php 8 years ago pmxe_render_xml_attributes.php 9 years ago pmxe_render_xml_element.php 8 years ago pmxe_render_xml_text.php 8 years ago str_getcsv.php 12 years ago wp_all_export_check_children_assign.php 10 years ago wp_all_export_clear_xss.php 4 years ago wp_all_export_generate_export_file.php 8 years ago wp_all_export_get_cpt_name.php 8 years ago wp_all_export_get_export_format.php 8 years ago wp_all_export_is_compatible.php 10 years ago wp_all_export_parse_field_name.php 9 years ago wp_all_export_posts_join.php 10 years ago wp_all_export_posts_where.php 8 years ago wp_all_export_pre_user_query.php 7 years ago wp_all_export_prepare_template_csv.php 7 years ago wp_all_export_prepare_template_xml.php 7 years ago wp_all_export_rand_char.php 10 years ago wp_all_export_remove_colons.php 10 years ago wp_all_export_remove_source.php 10 years ago wp_all_export_reverse_rules_html.php 8 years ago wp_all_export_rmdir.php 10 years ago wp_all_export_secure_file.php 9 years ago wp_all_export_url_title.php 10 years ago wp_all_export_write_article.php 10 years ago wp_redirect_or_javascript.php 12 years ago
wp_all_export_prepare_template_csv.php
577 lines
1 <?php
2
3 function wp_all_export_prepare_template_csv($exportOptions, &$templateOptions)
4 {
5 if ($exportOptions['ids']){
6
7 $required_add_ons = array();
8
9 $cf_list = array();
10 $attr_list = array();
11 $taxs_list = array();
12 $acf_list = array();
13 $implode_delimiter = ($exportOptions['delimiter'] == ',') ? '|' : ',';
14
15 if ( ! empty($exportOptions['is_user_export']) ) $templateOptions['pmui']['import_users'] = 1;
16
17 foreach ($exportOptions['ids'] as $ID => $value) {
18 if (empty($exportOptions['cc_type'][$ID])) continue;
19 $element_name = strtolower((!empty($exportOptions['cc_name'][$ID])) ? preg_replace('/[^a-z0-9_]/i', '', $exportOptions['cc_name'][$ID]) : 'untitled_' . $ID);
20 switch ($exportOptions['cc_type'][$ID]) {
21 case 'id':
22 $templateOptions['unique_key'] = '{'. $element_name .'[1]}';
23 $templateOptions['tmp_unique_key'] = '{'. $element_name .'[1]}';
24 $templateOptions['single_product_id'] = '{'. $element_name .'[1]}';
25 break;
26 case 'title':
27 case 'content':
28 case 'author':
29 case 'parent':
30 case 'slug':
31 $templateOptions[$exportOptions['cc_type'][$ID]] = '{'. $element_name .'[1]}';
32 $templateOptions['is_update_' . $exportOptions['cc_type'][$ID]] = 1;
33 break;
34 case 'excerpt':
35 $templateOptions['post_excerpt'] = '{'. $element_name .'[1]}';
36 $templateOptions['is_update_' . $exportOptions['cc_type'][$ID]] = 1;
37 break;
38 case 'status':
39 $templateOptions['status_xpath'] = '{'. $element_name .'[1]}';
40 $templateOptions['is_update_status'] = 1;
41 break;
42 case 'date':
43 $templateOptions[$exportOptions['cc_type'][$ID]] = '{'. $element_name .'[1]}';
44 $templateOptions['is_update_dates'] = 1;
45 break;
46 case 'post_type':
47 if ( empty($exportOptions['cpt']) ){
48 $templateOptions['is_override_post_type'] = 1;
49 $templateOptions['post_type_xpath'] = '{'. $element_name .'[1]}';
50 }
51 break;
52 case 'cf':
53 if ( ! empty($exportOptions['cc_value'][$ID]) ){
54
55 if ( ! in_array($exportOptions['cc_value'][$ID], $cf_list)) $cf_list[] = $exportOptions['cc_value'][$ID];
56 $templateOptions['custom_name'][] = $exportOptions['cc_value'][$ID];
57 $templateOptions['custom_value'][] = '{'. $element_name .'[1]}';
58 $templateOptions['custom_format'][] = 0;
59
60 }
61 break;
62 case 'woo':
63
64 if ( ! empty($exportOptions['cc_value'][$ID]) )
65 {
66 if (empty($required_add_ons['PMWI_Plugin']))
67 {
68 $required_add_ons['PMWI_Plugin'] = array(
69 'name' => 'WooCommerce Add-On Pro',
70 'paid' => true,
71 'url' => 'http://www.wpallimport.com/woocommerce-product-import/?utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=import-wooco-products-template'
72 );
73 }
74
75 if ( ! in_array($exportOptions['cc_label'][$ID], $cf_list)) $cf_list[] = $exportOptions['cc_label'][$ID];
76
77 switch ($exportOptions['cc_label'][$ID]) {
78 case '_visibility':
79 $templateOptions['is_product_visibility'] = 'xpath';
80 $templateOptions['single_product_visibility'] = '{'. $element_name .'[1]}';
81 break;
82 case '_stock_status':
83 $templateOptions['product_stock_status'] = 'xpath';
84 $templateOptions['single_product_stock_status'] = '{'. $element_name .'[1]}';
85 break;
86 case '_downloadable':
87 $templateOptions['is_product_downloadable'] = 'xpath';
88 $templateOptions['single_product_downloadable'] = '{'. $element_name .'[1]}';
89 break;
90 case '_virtual':
91 $templateOptions['is_product_virtual'] = 'xpath';
92 $templateOptions['single_product_virtual'] = '{'. $element_name .'[1]}';
93 break;
94 case '_price':
95 $templateOptions['single_product_regular_price'] = '{'. $element_name .'[1]}';
96 break;
97 case '_regular_price':
98 $templateOptions['single_product_regular_price'] = '{'. $element_name .'[1]}';
99 if ( ! in_array('_price', $cf_list)) $cf_list[] = '_price';
100 break;
101 case '_sale_price':
102 $templateOptions['single_product_sale_price'] = '{'. $element_name .'[1]}';
103 if ( ! in_array('_price', $cf_list)) $cf_list[] = '_price';
104 break;
105 case '_purchase_note':
106 $templateOptions['single_product_purchase_note'] = '{'. $element_name .'[1]}';
107 break;
108 case '_featured':
109 $templateOptions['is_product_featured'] = 'xpath';
110 $templateOptions['single_product_featured'] = '{'. $element_name .'[1]}';
111 break;
112 case '_weight':
113 $templateOptions['single_product_weight'] = '{'. $element_name .'[1]}';
114 break;
115 case '_length':
116 $templateOptions['single_product_length'] = '{'. $element_name .'[1]}';
117 break;
118 case '_width':
119 $templateOptions['single_product_width'] = '{'. $element_name .'[1]}';
120 break;
121 case '_height':
122 $templateOptions['single_product_height'] = '{'. $element_name .'[1]}';
123 break;
124 case '_sku':
125 $templateOptions['single_product_sku'] = '{'. $element_name .'[1]}';
126 $templateOptions['single_product_parent_id'] = '{parent_id[1]}';
127 break;
128 case '_sale_price_dates_from':
129 $templateOptions['single_sale_price_dates_from'] = '{'. $element_name .'[1]}';
130 break;
131 case '_sale_price_dates_to':
132 $templateOptions['single_sale_price_dates_to'] = '{'. $element_name .'[1]}';
133 break;
134 case '_sold_individually':
135 $templateOptions['product_sold_individually'] = 'xpath';
136 $templateOptions['single_product_sold_individually'] = '{'. $element_name .'[1]}';
137 break;
138 case '_manage_stock':
139 $templateOptions['is_product_manage_stock'] = 'xpath';
140 $templateOptions['single_product_manage_stock'] = '{'. $element_name .'[1]}';
141 break;
142 case '_stock':
143 $templateOptions['single_product_stock_qty'] = '{'. $element_name .'[1]}';
144 break;
145 case '_upsell_ids':
146 $templateOptions['single_product_up_sells'] = '{'. $element_name .'[1]}';
147 break;
148 case '_crosssell_ids':
149 $templateOptions['single_product_cross_sells'] = '{'. $element_name .'[1]}';
150 break;
151 case '_downloadable_files':
152 $templateOptions['single_product_files'] = '{'. $element_name .'_paths[1]}';
153 $templateOptions['single_product_files_names'] = '{'. $element_name .'_names[1]}';
154 break;
155 case '_download_limit':
156 $templateOptions['single_product_download_limit'] = '{'. $element_name .'[1]}';
157 break;
158 case '_download_expiry':
159 $templateOptions['single_product_download_expiry'] = '{'. $element_name .'[1]}';
160 break;
161 case '_download_type':
162 $templateOptions['single_product_download_type'] = '{'. $element_name .'[1]}';
163 break;
164 case '_product_url':
165 $templateOptions['single_product_url'] = '{'. $element_name .'[1]}';
166 break;
167 case '_button_text':
168 $templateOptions['single_product_button_text'] = '{'. $element_name .'[1]}';
169 break;
170 case '_tax_status':
171 $templateOptions['is_multiple_product_tax_status'] = 'no';
172 $templateOptions['single_product_tax_status'] = '{'. $element_name .'[1]}';
173 break;
174 case '_tax_class':
175 $templateOptions['is_multiple_product_tax_class'] = 'no';
176 $templateOptions['single_product_tax_class'] = '{'. $element_name .'[1]}';
177 break;
178 case '_backorders':
179 $templateOptions['product_allow_backorders'] = 'xpath';
180 $templateOptions['single_product_allow_backorders'] = '{'. $element_name .'[1]}';
181 break;
182 case 'attributes':
183
184 global $wp_taxonomies;
185
186 foreach ($wp_taxonomies as $key => $obj) { if (in_array($obj->name, array('nav_menu'))) continue;
187
188 if (strpos($obj->name, "pa_") === 0 and strlen($obj->name) > 3)
189 {
190 $attribute_name = preg_replace('/[^a-z0-9_]/i', '', $obj->name);
191 $templateOptions['attribute_name'][] = '{attributename' . $attribute_name .'[1]}';
192 $templateOptions['attribute_value'][] = '{attributevalue' . $attribute_name .'[1]}';
193 $templateOptions['in_variations'][] = "1";
194 $templateOptions['is_visible'][] = "1";
195 $templateOptions['is_taxonomy'][] = "1";
196 $templateOptions['create_taxonomy_in_not_exists'][] = "1";
197
198 $templateOptions['is_advanced'][] = "1";
199 $templateOptions['advanced_is_create_terms'][] = "yes";
200 $templateOptions['advanced_in_variations'][] = "xpath";
201 $templateOptions['advanced_is_visible'][] = "xpath";
202 $templateOptions['advanced_is_taxonomy'][] = "xpath";
203 $templateOptions['advanced_in_variations_xpath'][] = '{attributeinvariations' . $attribute_name .'[1]}';
204 $templateOptions['advanced_is_visible_xpath'][] = '{attributeisvisible' . $attribute_name .'[1]}';
205 $templateOptions['advanced_is_taxonomy_xpath'][] = '{attributeistaxonomy' . $attribute_name .'[1]}';
206
207 $attr_list[] = $obj->name;
208 }
209 }
210
211 global $wpdb;
212
213 $table_prefix = $wpdb->prefix;
214
215 $attributes = $wpdb->get_results($wpdb->prepare("SELECT DISTINCT meta_key FROM {$table_prefix}postmeta
216 WHERE {$table_prefix}postmeta.meta_key LIKE %s AND {$table_prefix}postmeta.meta_key NOT LIKE %s", 'attribute_%', 'attribute_pa_%'));
217
218 if ( ! empty($attributes))
219 {
220 foreach ($attributes as $attribute)
221 {
222 $attribute_name = preg_replace('/[^a-z0-9_]/i', '', str_replace('attribute_', '', $attribute->meta_key));
223 $templateOptions['attribute_name'][] = '{attributename' . $attribute_name .'[1]}';
224 $templateOptions['attribute_value'][] = '{attributevalue' . $attribute_name .'[1]}';
225 $templateOptions['in_variations'][] = "1";
226 $templateOptions['is_visible'][] = "1";
227 $templateOptions['is_taxonomy'][] = "1";
228 $templateOptions['create_taxonomy_in_not_exists'][] = "1";
229
230 $templateOptions['is_advanced'][] = "1";
231 $templateOptions['advanced_is_create_terms'][] = "yes";
232 $templateOptions['advanced_in_variations'][] = "xpath";
233 $templateOptions['advanced_is_visible'][] = "xpath";
234 $templateOptions['advanced_is_taxonomy'][] = "xpath";
235 $templateOptions['advanced_in_variations_xpath'][] = '{attributeinvariations' . $attribute_name .'[1]}';
236 $templateOptions['advanced_is_visible_xpath'][] = '{attributeisvisible' . $attribute_name .'[1]}';
237 $templateOptions['advanced_is_taxonomy_xpath'][] = '{attributeistaxonomy' . $attribute_name .'[1]}';
238
239 $attr_list[] = str_replace('attribute_', '', $attribute->meta_key);
240 }
241 }
242
243 break;
244 default:
245 # code...
246 break;
247 }
248 }
249 break;
250
251 case 'acf':
252
253 if (empty($required_add_ons['PMAI_Plugin']))
254 {
255 $required_add_ons['PMAI_Plugin'] = array(
256 'name' => 'ACF Add-On Pro',
257 'paid' => true,
258 'url' => 'http://www.wpallimport.com/advanced-custom-fields/?utm_source=export-plugin-free&utm_medium=required-addons&utm_campaign=acf'
259 );
260 }
261
262 $field_options = unserialize($exportOptions['cc_options'][$ID]);
263
264 // add ACF group ID to the template options
265 if( ! in_array($field_options['group_id'], $templateOptions['acf'])){
266 $templateOptions['acf'][$field_options['group_id']] = 1;
267 }
268
269 $field_tpl_key = strtolower($element_name);
270
271 $acf_list[] = '[' . $field_options['name'] . '] ' . $field_options['label'];
272
273 switch ($field_options['type']) {
274 case 'textarea':
275 case 'wysiwyg':
276 case 'wp_wysiwyg':
277 $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
278 break;
279 case 'text':
280 case 'number':
281 case 'email':
282 case 'password':
283 case 'url':
284 case 'oembed':
285 case 'image':
286 case 'file':
287 case 'date_picker':
288 case 'color_picker':
289 case 'acf_cf7':
290 case 'gravity_forms_field':
291 case 'limiter':
292 case 'date_time_picker':
293
294 $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
295
296 break;
297 case 'post_object':
298 case 'page_link':
299 case 'user':
300
301 if ($field_options['multiple'])
302 {
303 if ($implode_delimiter == "|")
304 $templateOptions['fields'][$field_options['key']] = '[str_replace("|", ",",{' . $field_tpl_key . '[1]})]';
305 else
306 $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
307 }
308 else
309 {
310 $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
311 }
312
313 break;
314 case 'gallery':
315 case 'relationship':
316
317 if ($implode_delimiter == "|")
318 $templateOptions['fields'][$field_options['key']] = '[str_replace("|", ",",{' . $field_tpl_key . '[1]})]';
319 else
320 $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
321
322 break;
323 case 'select':
324 case 'checkbox':
325
326 $templateOptions['is_multiple_field_value'][$field_options['key']] = 'no';
327
328 if ($implode_delimiter == "|")
329 $templateOptions['fields'][$field_options['key']] = '[str_replace("|", ",",{' . $field_tpl_key . '[1]})]';
330 else
331 $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
332
333 break;
334 case 'radio':
335 case 'true_false':
336
337 $templateOptions['is_multiple_field_value'][$field_options['key']] = 'no';
338
339 $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
340
341 break;
342 case 'location-field':
343 case 'google_map':
344
345 $templateOptions['fields'][$field_options['key']]['address'] = '{' . $field_tpl_key . '_address[1]}';
346 $templateOptions['fields'][$field_options['key']]['lat'] = '{' . $field_tpl_key . '_lat[1]}';
347 $templateOptions['fields'][$field_options['key']]['lng'] = '{' . $field_tpl_key . '_lng[1]}';
348
349 break;
350 case 'paypal_item':
351
352 $templateOptions['fields'][$field_options['key']]['item_name'] = '{' . $field_tpl_key . '_item_name[1]}';
353 $templateOptions['fields'][$field_options['key']]['item_description'] = '{' . $field_tpl_key . '_item_description[1]}';
354 $templateOptions['fields'][$field_options['key']]['price'] = '{' . $field_tpl_key . '_price[1]}';
355
356 break;
357 case 'taxonomy':
358
359 $taxonomy_options = array();
360
361 $single_term = new stdClass;
362 $single_term->item_id = 1;
363 $single_term->parent_id = NULL;
364 $single_term->xpath = '{' . $field_tpl_key . '[1]}';
365 $single_term->assign = false;
366
367 $taxonomy_options[] = $single_term;
368
369 $templateOptions['is_multiple_field_value'][$field_options['key']] = 'no';
370
371 $templateOptions['fields'][$field_options['key']] = json_encode($taxonomy_options);
372
373 break;
374 case 'repeater':
375
376 $templateOptions['fields'][$field_options['key']]['is_variable'] = 'csv';
377
378 $templateOptions['fields'][$field_options['key']]['separator'] = $implode_delimiter;
379
380 if (class_exists('acf')){
381
382 global $acf;
383
384 if ($acf and version_compare($acf->settings['version'], '5.0.0') >= 0){
385
386 $sub_fields = get_posts(array('posts_per_page' => -1, 'post_type' => 'acf-field', 'post_parent' => (( ! empty($field_options['id'])) ? $field_options['id'] : $field_options['ID']), 'post_status' => 'publish'));
387
388 if ( ! empty($sub_fields) ){
389
390 foreach ($sub_fields as $n => $sub_field){
391
392 $templateOptions['fields'][$field_options['key']]['rows']['1'][$sub_field->post_name] = '{' . $field_tpl_key . '_' . strtolower($sub_field->post_excerpt) . '[1]}';
393
394 }
395 }
396
397 } else{
398
399 if ( ! empty($field['sub_fields']))
400 {
401 foreach ($field['sub_fields'] as $n => $sub_field){
402
403 $templateOptions['fields'][$field_options['key']]['rows']['1'][$sub_field['key']] = '{' . $field_tpl_key . '_' . strtolower($sub_field['name']) . '[1]}';
404
405 }
406 }
407 }
408
409 }
410
411 break;
412 case 'flexible_content':
413
414 break;
415
416 default:
417
418 $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
419
420 break;
421
422 }
423
424 break;
425
426 case 'attr':
427 //$element_name = 'woo_' . $element_name;
428
429 if ( ! empty($exportOptions['cc_value'][$ID]) and ! in_array($exportOptions['cc_value'][$ID], $attr_list) ) {
430
431 $templateOptions['attribute_name'][] = str_replace('pa_', '', $exportOptions['cc_value'][$ID]);
432 $templateOptions['attribute_value'][] = '{attribute_'. $element_name .'[1]}';
433 $templateOptions['in_variations'][] = "1";
434 $templateOptions['is_visible'][] = "1";
435 $templateOptions['is_taxonomy'][] = "1";
436 $templateOptions['create_taxonomy_in_not_exists'][] = "1";
437 $attr_list[] = $exportOptions['cc_value'][$ID];
438
439 }
440 break;
441 case 'cats':
442 if ( ! empty($exportOptions['cc_value'][$ID]) ){
443 switch ($exportOptions['cc_label'][$ID]) {
444 case 'product_type':
445 $templateOptions['is_multiple_product_type'] = 'no';
446 $templateOptions['single_product_type'] = '{'. $element_name .'[1]}';
447 break;
448 case 'product_shipping_class':
449 $templateOptions['is_multiple_product_shipping_class'] = 'no';
450 $templateOptions['single_product_shipping_class'] = '{'. $element_name .'[1]}';
451 break;
452 default:
453 $taxonomy = $exportOptions['cc_value'][$ID];
454 $templateOptions['tax_assing'][$taxonomy] = 1;
455
456 if (is_taxonomy_hierarchical($taxonomy)){
457 $templateOptions['tax_logic'][$taxonomy] = 'hierarchical';
458 $templateOptions['tax_hierarchical_logic_entire'][$taxonomy] = 1;
459 $templateOptions['multiple_term_assing'][$taxonomy] = 1;
460 $templateOptions['tax_hierarchical_delim'][$taxonomy] = '>';
461 $templateOptions['is_tax_hierarchical_group_delim'][$taxonomy] = 1;
462 $templateOptions['tax_hierarchical_group_delim'][$taxonomy] = $implode_delimiter;
463 $templateOptions['tax_hierarchical_xpath'][$taxonomy] = array('{'. $element_name .'[1]}');
464 }
465 else{
466 $templateOptions['tax_logic'][$taxonomy] = 'multiple';
467 $templateOptions['multiple_term_assing'][$taxonomy] = 1;
468 $templateOptions['tax_multiple_xpath'][$taxonomy] = '{'. $element_name .'[1]}';
469 $templateOptions['tax_multiple_delim'][$taxonomy] = $implode_delimiter;
470 }
471 $taxs_list[] = $taxonomy;
472 break;
473 }
474 }
475 break;
476 case 'media':
477 $templateOptions['download_featured_image'] = '{'. $element_name .'_images[1]}';
478 $templateOptions['download_featured_delim'] = $implode_delimiter;
479 $templateOptions['set_image_meta_title'] = 1;
480 $templateOptions['set_image_meta_caption'] = 1;
481 $templateOptions['set_image_meta_alt'] = 1;
482 $templateOptions['set_image_meta_description'] = 1;
483 $templateOptions['image_meta_title'] = '{'. $element_name .'_titles[1]}';
484 $templateOptions['image_meta_title_delim'] = $implode_delimiter;
485 $templateOptions['image_meta_caption'] = '{'. $element_name .'_captions[1]}';
486 $templateOptions['image_meta_caption_delim'] = $implode_delimiter;
487 $templateOptions['image_meta_alt'] = '{'. $element_name .'_alts[1]}';
488 $templateOptions['image_meta_alt_delim'] = $implode_delimiter;
489 $templateOptions['image_meta_description'] = '{'. $element_name .'_descriptions[1]}';
490 $templateOptions['image_meta_description_delim'] = $implode_delimiter;
491 $templateOptions['is_update_images'] = 1;
492 $templateOptions['update_images_logic'] = 'add_new';
493 break;
494 case 'attachments':
495 $templateOptions['attachments'] = '{'. $element_name .'_attachments[1]}';
496 $templateOptions['atch_delim'] = $implode_delimiter;
497 $templateOptions['is_update_attachments'] = 1;
498 break;
499
500 // Export Users
501 case 'user_login':
502 $templateOptions['pmui']['login'] = '{'. $element_name .'[1]}';
503 $templateOptions['is_update_login'] = 1;
504 break;
505 case 'user_pass':
506 $templateOptions['pmui']['pass'] = '{'. $element_name .'[1]}';
507 $templateOptions['is_update_password'] = 1;
508 break;
509 case 'user_nicename':
510 $templateOptions['pmui']['nicename'] = '{'. $element_name .'[1]}';
511 $templateOptions['is_update_nicename'] = 1;
512 break;
513 case 'user_email':
514 $templateOptions['pmui']['email'] = '{'. $element_name .'[1]}';
515 $templateOptions['is_update_email'] = 1;
516 break;
517 case 'user_registered':
518 $templateOptions['pmui']['registered'] = '{'. $element_name .'[1]}';
519 $templateOptions['is_update_registered'] = 1;
520 break;
521 case 'display_name':
522 $templateOptions['pmui']['display_name'] = '{'. $element_name .'[1]}';
523 $templateOptions['is_update_display_name'] = 1;
524 break;
525 case 'user_url':
526 $templateOptions['pmui']['url'] = '{'. $element_name .'[1]}';
527 $templateOptions['is_update_url'] = 1;
528 break;
529
530 case 'first_name':
531 $templateOptions['pmui']['first_name'] = '{'. $element_name .'[1]}';
532 $templateOptions['is_update_first_name'] = 1;
533 break;
534 case 'last_name':
535 $templateOptions['pmui']['last_name'] = '{'. $element_name .'[1]}';
536 $templateOptions['is_update_last_name'] = 1;
537 break;
538 case 'wp_capabilities':
539 $templateOptions['pmui']['role'] = '{'. $element_name .'[1]}';
540 $templateOptions['is_update_role'] = 1;
541 break;
542 case 'nickname':
543 $templateOptions['pmui']['nickname'] = '{'. $element_name .'[1]}';
544 $templateOptions['is_update_nickname'] = 1;
545 break;
546 case 'description':
547 $templateOptions['pmui']['description'] = '{'. $element_name .'[1]}';
548 $templateOptions['is_update_description'] = 1;
549 break;
550
551 default:
552
553 break;
554 }
555 }
556 if ( ! empty($cf_list) ){
557 $templateOptions['is_update_custom_fields'] = 1;
558 $templateOptions['custom_fields_list'] = $cf_list;
559 }
560 if ( ! empty($attr_list) ){
561 $templateOptions['is_update_attributes'] = 1;
562 $templateOptions['attributes_list'] = $attr_list;
563 $templateOptions['attributes_only_list'] = implode(',', $attr_list);
564 }
565 if ( ! empty($taxs_list) ){
566 $templateOptions['is_update_categories'] = 1;
567 $templateOptions['taxonomies_list'] = $taxs_list;
568 }
569 if ( ! empty($acf_list) ){
570 $templateOptions['is_update_acf'] = 1;
571 $templateOptions['acf_list'] = $acf_list;
572 }
573
574 $templateOptions['required_add_ons'] = $required_add_ons;
575
576 }
577 }