| | |
| | | <?php |
| | | |
| | | use JVBase\registrar\Registrar; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | |
| | | return $out; |
| | | } |
| | | |
| | | function jvbMetaTermList(string $value, string $tax, bool $icon = true):string |
| | | { |
| | | if ($value === '') { |
| | | return ''; |
| | | } |
| | | $tax = jvbCheckBase($tax); |
| | | $terms = array_map('absint', explode(',', $value)); |
| | | $out = []; |
| | | foreach ($terms as $t) { |
| | | $term = get_term($t, $tax); |
| | | if ($term && !is_wp_error($term)) { |
| | | $url = get_term_link($t, $tax); |
| | | $out[] = '<li><a href="'.$url.'" title="View more in '.$term->name.'" rel="tag">'.$term->name.'</a></li>'; |
| | | } |
| | | } |
| | | |
| | | $registrar = Registrar::getInstance($tax); |
| | | $icon = ($icon && $registrar) ? $registrar->getIcon() : ''; |
| | | $icon = ($icon === '') ? '' : jvbIcon($icon); |
| | | $title = $registrar ? '<li class="title">'.$icon.$registrar->getSingular().'</li>' : ''; |
| | | return (!empty($out)) ? '<ul class="term-list '.jvbNoBase($tax).'">'.$title.implode('',$out).'</ul>' : ''; |
| | | } |
| | | |
| | | /** |
| | | * @param int $artistID |
| | | * @param string $taxonomy |