get_terms(); show private posts when logged in

Hi have a custom post type “FAQ”.
I got some “FAQ’s” that are private, also only visible for logged in users.

I used “get_terms()” funktion for a widget that is listing links to the categories of those “FAQ’s”.

The “get_terms” does not list the terms, that have only private “FAQ’s”.

$taxonomy = 'faq_kategorien';
$tax_terms = get_terms($taxonomy);
foreach ($tax_terms as $tax_term) {
    echo  '<li><a href="https://wordpress.stackexchange.com/faq_kategorien/".$tax_term->slug.'">'.$tax_term->name.'</a></li>';
}

How can i get those terms that include only “private” posts ?

1 Answer
1

We had the same issue in one of our projects and we find the solution here

This other doesn’t work in our case, but maybe is a second option for you.

Leave a Comment