Solved
<?php
function my_get_category( $ids ) {
if ( ! empty( $ids ) ) {
$return = array();
$ids = explode( ",", $ids );
foreach ( $ids as $id ) {
$id = trim( $id );
$term = get_terms( array(
'taxonomy' => 'product_cat',
'hide_empty' => false,
'meta_query' => array(
'key' => 'intercambio_cat',
'value' => $id,
'compare' => '='
)
) );
if ( ! empty( $term ) ) {
$return[] = $term[0]->slug;
}
}
if ( ! empty( $return ) ) {
return implode( ">", $return );
}
}
}
?>
-
This reply was modified 4 years, 11 months ago by eduits.