【发布时间】:2019-09-15 04:58:05
【问题描述】:
我有一个轮播插件,它可以做各种事情,它只显示已发布的产品:
$common_args = array(
'post_type' => 'product',
'posts_per_page' => !empty($posts_per_page) ? intval($posts_per_page) : 4,
'post_status' => 'publish',
'ignore_sticky_posts' => true,
'no_found_rows' => true,
);
但我需要它来排除“隐藏”产品,这些产品在技术上仍然发布,只是不可见。或者,如果它排除特定类别的产品(我所有隐藏的产品都在两个特定类别中),我可以使用它。
请问我该怎么做?
【问题讨论】:
标签: php wordpress woocommerce custom-taxonomy taxonomy-terms