Here is what I have:
A custom post type that has a custom meta value added to a post that stores the posts expiry date. When the post passes this expiry date it no longer shows on the site.
This works but I’m using something like this to list the terms for the custom post type:
$termcats = get_terms('dcategory', 'hide_empty=0&orderby=name&pad_counts=1');
I’m showing the count of posts in the listed terms but the problem here is that the count shows all post whether or not if the post has expired. So for example I have one post in the term called test
and that post is expired. The above code shows there is one post but when the user click the category they get a blank list.
So I need a way to hook into get_terms() to ignore posts that have expired according to my date field in meta values.