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