Home › Forums › ACF PRO › Displaying relationship as a subfield on a CPT › Reply To: Displaying relationship as a subfield on a CPT
Hi Byrd,
You’re right : Because of your ‘location’ data is in subfield you can’t query post by using it as meta_query (to be honest you can but by using an ugly solution).
I had the same issue with a repeater subfield and I got a very helpfull advice from John Huebner : See my post here.
To resume : Use the ‘save_post’ filter on your event CPT to save with add_post_meta the location as simple metadata (For example : ‘wp_location’). Then you’ll be able to easily query it.
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.