Home › Forums › ACF PRO › % in query on repeater › Reply To: % in query on repeater
I think that you missed the important point of my article. Make sure you read the code example and the comments in the example.
You’re using update_field()
which is updating an acf field and the new field is outside of ACF and added using standard WP function https://codex.wordpress.org/Function_Reference/add_post_meta
You’re also updating the field with an array and you can’t do a query based on an array stored in the database.
The idea is that you get each row of the repeater. Concatenate something into a string, for example 100/90/17
and then save each of these strings using add_post_meta(). Then when you query the posts you do a meta query on this new meta_key and the value you query by is the concatenated a similarly concatenated string.
This will be more difficult in your case because you’re using a taxonomy for these values so you’ll need to get the string values you want to concatenate from the terms. But the idea is the same. You need to have unique values stored into a standard WP custom field that you can query on.
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.