Creating a Search Array From Multiple Tables
I'm working with a client's WordPress site that has user submissions (via TDO Mini Forms) from multiple countries, and they would like to be able to search for posts by region – Europe, Africa, Central America, etc.
There is a custom field already in place for the user's country of origin. I also have a separate table that maps countries to regions. What I want to do is make it so that the user can select Europe, for example, from a map, and have WP return any posts from countries that are mapped as EU.
What's the best way to accomplish this? Not only do I not want to reinvent the wheel, but WP can be very fussy about it search functions.
My first thought was to perform a search of the Regions table, return all of the countries as an array, and then use that array to perform a WP search, but I'm not finding how to do that without creating an AND search, which returns nothing.
Thanks for any help.
ty
Topic wp-parse-args Wordpress search
Category Web