Is it possible to search for values in a specific field - for example, I have a custom field type called “job_type” which can contain the values “permanent, parttime,contract,freelance” and I want to be able to search and filter based on that. Eg, all the posts with php in the title/body and freelance in the “job_type” field.
[update]
A workaround I just found while posting this is to label all my form fields “keywords[]”
and change line 478 in core.regex.php from
$str = strip_tags($str);if (is_array($str)) {
$str = implode(' ',$str);
}
$str = strip_tags($str);This will quickly turn my search for “css” in “freelance” job_types to “css freelance” which will match both the fields. But I’m not sure if I’m going to miss some edge cases - is there an official way to do this?
Moved to HowTo by Moderator