options
3 days ago
template
1 month ago
confirm.php
1 month ago
element.php
1 month ago
error.php
1 month ago
evaluate.php
1 month ago
evaluate_variations.php
1 month ago
filters.php
1 month ago
full-preview-modal.php
1 month ago
index.php
1 month ago
options.php
1 month ago
preview.php
1 month ago
preview_images.php
1 month ago
preview_prices.php
1 month ago
preview_taxonomies.php
1 month ago
process-complete.php
1 month ago
process.php
1 month ago
tag.php
1 month ago
template.php
1 month ago
warning.php
1 month ago
preview_taxonomies.php
79 lines
| 1 | <?php if ( ! defined( 'ABSPATH' ) ) exit; // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals ?> |
| 2 | <div id="post-preview" class="wpallimport-preview_taxonomies"> |
| 3 | |
| 4 | <div class="title"> |
| 5 | <div class="navigation"> |
| 6 | <?php if ($tagno > 1): ?><a href="#prev" class="previous_element"> </a><?php else: ?><span class="previous_element"> </span><?php endif ?> |
| 7 | <?php /* translators: see placeholders in the string below */ ?> |
| 8 | <?php echo wp_kses(sprintf(__('<strong><input type="text" value="%1$s" name="tagno" class="tagno"/></strong><span class="out_of"> of <strong class="pmxi_count">%2$s</strong></span>', 'wp-all-import'), intval($tagno), intval(PMXI_Plugin::$session->count)), array('strong' => array('class' => array()), 'span' => array('class' => array()), 'input' => array('type' => array(), 'value' => array(), 'name' => array(), 'class' => array()))); ?> |
| 9 | <?php if ($tagno < PMXI_Plugin::$session->count): ?><a href="#next" class="next_element"> </a><?php else: ?><span class="next_element"> </span><?php endif ?> |
| 10 | </div> |
| 11 | </div> |
| 12 | |
| 13 | <div class="wpallimport-preview-content"> |
| 14 | <?php if ($this->errors->get_error_codes()): ?> |
| 15 | <?php $this->error() ?> |
| 16 | <?php endif ?> |
| 17 | |
| 18 | <h3><?php esc_html_e('Test Taxonomies Hierarchy', 'wp-all-import'); ?></h3> |
| 19 | |
| 20 | <?php |
| 21 | if ( ! empty($tax_hierarchical) ): |
| 22 | foreach ($tax_hierarchical as $ctx => $terms_arr): |
| 23 | $tax_info = get_taxonomy($ctx); |
| 24 | ?> |
| 25 | <p><?php echo esc_html($tax_info->labels->name); ?></p> |
| 26 | <?php |
| 27 | if (!empty($terms_arr) and is_array($terms_arr)){ |
| 28 | foreach ($terms_arr as $terms) { |
| 29 | |
| 30 | $terms = wp_all_import_filter_html_kses($terms); |
| 31 | |
| 32 | // Apply mapping before splitting via separator symbol |
| 33 | if (! empty($post['tax_enable_mapping'][$ctx]) and !empty($post['tax_logic_mapping'][$ctx])){ |
| 34 | $mapping_rules = json_decode($post['tax_mapping'][$ctx], true); |
| 35 | if ( ! empty( $mapping_rules) ){ |
| 36 | foreach ($mapping_rules as $rule) { |
| 37 | if ( ! empty($rule[trim($terms)])){ |
| 38 | $terms = trim($rule[trim($terms)]); |
| 39 | break; |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | $terms_a = ( ! empty($post['tax_hierarchical_delim'][$ctx])) ? explode($post['tax_hierarchical_delim'][$ctx], $terms) : explode(',', $terms); |
| 46 | |
| 47 | if ( ! empty($terms_a) and is_array($terms_a)){ |
| 48 | foreach ($terms_a as $lvl => $term) { |
| 49 | if ( ! empty($post['tax_mapping'][$ctx]) and empty($post['tax_logic_mapping'][$ctx])){ |
| 50 | $mapping_rules = json_decode($post['tax_mapping'][$ctx], true); |
| 51 | if ( ! empty($mapping_rules) ){ |
| 52 | foreach ($mapping_rules as $rule_number => $rule) { |
| 53 | if ( ! empty($rule[trim($term)])){ |
| 54 | $term = trim($rule[trim($term)]); |
| 55 | break; |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | if (!empty($term)) { |
| 61 | ?> |
| 62 | <p><?php echo esc_html(str_pad(trim($term), strlen(trim($term)) + $lvl, "-", STR_PAD_LEFT)); ?></p> |
| 63 | <?php |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | else{ |
| 68 | ?> |
| 69 | <p><?php echo esc_html($terms_a); ?></p> |
| 70 | <?php |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | endforeach; |
| 76 | endif; ?> |
| 77 | </div> |
| 78 | |
| 79 | </div> |