admin管理员组

文章数量:1124168

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?

本文标签: