Answer the question
In order to leave comments, you need to log in
How to correctly fill WP_Query{} wordpress arguments?
Through acf created fields "sex", "profession". Then through a simple form I want to filter the records
<form method="POST">
<div> </div>
<input name="wsex[]" value="Male" type="checkbox"> Мужчина <br>
<input name="wsex[]" value="Female" type="checkbox"> Женщина <br>
<div> <hr>
<input name="wprofession[]" value="cook" type="checkbox"> повар <br>
<input name="wprofession[]" value="watchman" type="checkbox"> сторож <br>
</div>
</form>
$args = [
'meta_query' => [
'relation' => 'OR', // AND
[
'key' => 'sex',
'value' => $_POST['wsex']
],
[
'key' => 'profession',
'value' => $_POST['wprofession']
]
]
];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question