I have 2 custom post types connected to the same custom taxonomy. On a particular page I needed to filter one particular post type using the filter that I created for my custom taxonomy. I was able to get a dropdown of my custom taxonomy using <?php wp_dropdown_categories( $args ); ?>
but what I noticed was that it listed all the terms for which atleast one of the 2 custom post types had a post linked to it.
Here's an example of what I'm trying to do:
1. I have 2 custom post types: Cars and Bikes
2. I have a custom taxonomy (Location)
3. On a specific page, I need to filter the post type Cars using the dropdown that I created for my taxonomy
4. The problem that I'm facing is that the dropdown for my taxonomy Location, lists the locations that even posts from the Bikes post type are also connected to. So for example, if I have posts from the Cars post type connected to USA, UK, Australia and a post from the Bikes post type connected to Brazil, the dropdown for my custom taxonomy lists the 'Brazil' term too even though none of the Cars posts are linked to it.
Is it possible to restrict the dropdown for taxonomies to one custom post type?