Home › Forums › Front-end Issues › Create a filter by repeater sub field › Reply To: Create a filter by repeater sub field
The relationship field saves the data as serialized IDs of the post objects. To learn more about serialize, please take a look at this page: http://php.net/manual/en/function.serialize.php.
To search only the ID, I believe you can do it like this:
$args = array( 'numberposts' => -1, 'post_type' => 'noticias', 'meta_query' => array( array( 'key' => 'cobertura_%_pais', 'compare' => '=', 'value' => '"' . $pais . '"', ) ) );
To learn more about querying relationship field, please take a look at this page: https://www.advancedcustomfields.com/resources/querying-relationship-fields/.
Also, “_location_1_country” is a reference key used by ACF to save and load the right value, so you don’t need to worry about it.
I hope this helps 🙂
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!
🚀 This week’s session of ACF Chat Fridays dips into the preliminary results of our first ever user survey. Don’t miss it! https://t.co/3UtvQbDwNm pic.twitter.com/kMwhaJTkZc— Advanced Custom Fields (@wp_acf) May 9, 2023
© 2023 Advanced Custom Fields.