admin管理员组文章数量:1344201
My code is simply:
$cats = get_terms(
[
'taxonomy' => 'category',
],
);
Obviously, hide_empty
is true
by default. There's a category that only contains scheduled posts and it's not being returned; I want to override this behavior. Somewhere in the code the value of post_status
is involved, but I searched the source of WP_Term_Query
and found nothing. Is there a filter that can be used to override this, or do I have to write my own SQL query?
本文标签:
版权声明:本文标题:categories - When using get_terms with hide_empty = true, terms that only contain scheduled posts are not returned. How to overr 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736617902a1945511.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论