I'm searching for a solution for my WordPress custom query problem.
I have a search-form where the user can input some text, this text can be a word from the post_title
or an meta_value (Company ID)
.
I need to search the string in post_title
OR the meta_key-Field
"id-number",
but I also have some other additional search params.
These are my Args for the WP_Query
:
Array(
[post_type] => company
[pagination] => 1
[posts_per_page] => 10
[paged] => 1
[meta_query] => Array
(
[relation] => AND
[0] => Array
(
[0] => Array
(
[key] => id-number
[value] => FOOBAR
)
[1] => Array
(
[key] => post_title
[value] => FOOBAR
[compare] => LIKE
)
[relation] => OR
)
[1] => Array
(
[relation] => AND
[0] => Array
(
[0] => Array
(
[key] => country
[value] => USA
)
[relation] => OR
)
)
)
)
Array[meta_query][0][1] (post_title)
is only a placeholder - i know that can't work, but how can i search for
(id-number OR post_title)
AND (all other vars...)