Home › Forums › Add-ons › Repeater Field › Search engine with repeater field and wp_query › Reply To: Search engine with repeater field and wp_query
Thinking about it, it might be possible, but it could cause a performance issue.
If you have a limited number of rows in the DB for this. In my example let’s say that there are no more than 2 rows in the repeater
$meta_query = array(
'relation' => 'OR',
// first potential row
array(
'relation' => 'AND',
array(
'key' => 'prix_0_typo_prog',
'value' => $_POST['typologie'],
'compare' => '=',
),
array(
'key' => 'prix_0_prix_prog',
'value' => $prix,
'type' => 'NUMERIC',
'compare' => '<='
)
),
// second potential row
array(
'relation' => 'AND',
array(
'key' => 'prix_1_typo_prog',
'value' => $_POST['typologie'],
'compare' => '=',
),
array(
'key' => 'prix_1_prix_prog',
'value' => $prix,
'type' => 'NUMERIC',
'compare' => '<='
)
),
// continue for every potential row
);
But if you have too many rows and too many nested queries it will eventually time out.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.