【发布时间】:2017-08-15 08:41:54
【问题描述】:
我尝试获取我的产品标签的名称。像这样
$args = array( 'post_type' => 'product');
$list_tags = [];
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
$tag = get_the_term_list($post->ID, 'product_tag', '', ',' );
array_push($list_tags, $tag );
endwhile;
return $list_tags;
我获得了我的标签列表,但我想要这个标签的 slug。
有什么想法吗?
【问题讨论】:
标签: php wordpress woocommerce product