| | |
| | | */ |
| | | public static function getTermPath(WP_Term $term, bool $returnArray = false): string|array { |
| | | if (!is_taxonomy_hierarchical($term->taxonomy)) { |
| | | return $term->name; |
| | | return html_entity_decode($term->name); |
| | | } |
| | | |
| | | $path = []; |
| | | $currentTerm = $term; |
| | | |
| | | while ($currentTerm) { |
| | | array_unshift($path, $currentTerm->name); |
| | | array_unshift($path, html_entity_decode($currentTerm->name)); |
| | | |
| | | if ($currentTerm->parent) { |
| | | $currentTerm = get_term($currentTerm->parent); |
| | |
| | | </button> |
| | | </nav> |
| | | |
| | | |
| | | <p class="message" hidden aria-live="polite"> |
| | | { <span>loading items</span> } |
| | | </p> |
| | | <!-- Terms list --> |
| | | <ul class="items-container col start" role="listbox" aria-label="Available terms"> |
| | | <!-- Terms will be populated here --> |
| | | </ul> |
| | | |
| | | <p class="message" hidden aria-live="polite"> |
| | | { <span>loading items</span> } |
| | | </p> |
| | | <button class="submit-term" hidden data-ignore><strong>Create: </strong> "<span></span>"</button> |
| | | |
| | | <!-- Infinite scroll sentinel --> |
| | |
| | | </button> |
| | | <?php if ($hasAutocomplete !== '') { ?> |
| | | <input type="text" id="<?= $this->base ?><?= esc_attr($this->config['name']) ?>-autocomplete" autocomplete="off" data-ignore data-autocomplete> |
| | | <p class="message" hidden aria-live="polite"> |
| | | { <span>loading items</span> } |
| | | </p> |
| | | <div class="auto-wrapper" hidden> |
| | | <ul class="search-results"> |
| | | </ul> |
| | | <p class="message" hidden aria-live="polite"> |
| | | { <span>loading items</span> } |
| | | </p> |
| | | <button class="submit-term" hidden data-ignore><strong>Create: </strong> "<span></span>"</button> |
| | | </div> |
| | | |
| | |
| | | <span><?= esc_html($termPath) ?></span> |
| | | <button type="button" |
| | | class="remove-term row" |
| | | aria-label="Remove <?= esc_attr($term->name) ?>"> |
| | | aria-label="Remove <?= html_entity_decode($term->name) ?>"> |
| | | <?= jvbIcon('x') ?> |
| | | </button> |
| | | </div> |