【发布时间】:2023-03-17 19:44:01
【问题描述】:
我使用这个函数来获取和显示每个产品的所有标签:
public function get_product_tags_list() {
global $product;
if ( ! is_a( $product, 'WC_Product' ) ) {
return;
}
$separator = '<span class="separator">, </span></li><li>';
$before = '<ul><li>';
$after = '</li></ul>';
return get_the_term_list( $product->get_id(), 'product_tag', $before, $separator, $after );
}
如何按 slug 降序排列我的标签列表?
问候
【问题讨论】:
标签: php wordpress woocommerce product taxonomy-terms