Compare strings with meta_query
-
Hi.
I have an input search field (city, state, zip) that does a meta_query against an address custom field.
My question is if you can compare strings where if any words match between the two strings it will return true.
In the meta_query args I set the compare arg to “LIKE”. It sort of works.
If someone types in just “Connecticut” it pulls posts with Connecticut in the custom field. However, if someone types in “Connecticut USA” it pulls nothing.
I want to make the search as broad as possible so as long as the person has one matching word in the input, it will return true.
Is something like this possible?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Compare strings with meta_query’ is closed to new replies.