Home › Forums › General Issues › Query relationship field in repeater field › Reply To: Query relationship field in repeater field
Yes, it would be possible to hook into the acf/update_value filter and update or remove connections based on the $value.
This would be a very good solution, however, will require some complex coding which will be up to you.
As to your previous statement regarding post ID / object:
The relationship field will always save the ID’s, never any information about the actual $post. No change will be made to the DB by this option, only the returned value via get_field.
Basically, having the relationship field within the repeater prevents querying from being possible. If the relationship field is on the root level, then yes, you can easily query backwards and forwards from artists to events (there is a tutorial for this on the docs page).
I use p2p in my advanced websites and also, so does bbPress – the wordpress forum plugin!
Good luck
Cheers
E
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!
ACF PRO’s Flexible Content field allows you to create smaller pieces of UI and compose them into whole flexible patterns. In our latest article, we show how to use it to create swappable site sections and integrate it all in a theme.https://t.co/ZRocH8oJSp
— Advanced Custom Fields (@wp_acf) January 24, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.