I am building a job board and have three post types - Company, Job, and Portfolio.
The portfolio CPT is a proxy for users as I can't filter by user attributes.
All thre CPTs need a field to show the country location but with DIFFERENT Meaning.
Company - - where the company is based
Job -- where the job is based
Portfolio - where the user wants to work.
I have only used taxonomies where the meaning of the taxonomy is consistent across all CPTs it is assigned to. That's why I am a bit hesitant to use Location as a taxonomy for these CPTs but technically it should work just fine and I would be able to filter all three CPTs by location.
What would you suggest as the right approach to design this?
Should I create a custom select field or should I use taxonomy?
Yes I think technically it should work fine, and taxonomy filters are inherently more performant than custom field filters so it should work well in a custom search for any of these CPTs. One thing you may want to consider in this case is how taxonomy archives will be implemented. In this case, all 3 CPTs could be represented in the same taxonomy archive, so that may or may not be ideal based on your site requirements. Other than that, I don't see any issues with using this type of taxonomy filter.
Thanks, Chris.
As a follow-up has Toolset created a ready-made import of the list of countries in the world and even all U.S States?
Doing all that manually will be a pain.
Toolset does not maintain such lists, no. I've seen other clients contribute to shared modules that contain country / state / province lists in custom fields, but I'm not sure how much usefulness you will find in these as they may not conform to your needs as a taxonomy:
https://toolset.com/forums/topic/countries-states-cities-taxonomy/
https://toolset.com/forums/topic/how-to-import-states-and-countries-into-selects-for-fields
Other public resources I've seen used for this purpose:
https://wordpress.stackexchange.com/questions/26420/fast-way-to-add-countries-as-a-custom-taxonomy-term
My issue is resolved now. Thank you!