Yes there is a query, but it gets rather complex, as several table joins are required. In plain english using SQL logic, you want a count of distinct users who are authors of posts associated with a particular taxonomy where the term is ‘whatever’. Unfortunately, my SQL skills prevent me from providing a workable query. Maybe someone else will be able to help you, but at least you know it’s possible.
If that’s too mind boggling, you could use WP_Query to retrieve all posts associated with a taxonomy term, then use code to tally up the number of distinct authors. Very inefficient compared to SQL, but fairly easy to code. The only challenge is ensuring you are incrementing the counter only when a author hasn’t been counted yet.
Thread Starter
AliMH
(@alimh)
thanks bcworkz i know i can query all posts and then count em but i use another way, i’m developing a site with no post therefor i add my own hook to add count to user meta when user create a new post defined taxonomy, its way efficent and way better than any other solutions.
Thread Starter
AliMH
(@alimh)
anyway if someone able to add this query it will useful for future, maybe someone need it.