Home › Forums › Feature Requests › Feature Request – Relationship Field › Reply To: Feature Request – Relationship Field
Why is this not core ACF?
The following is my opinion and experience from years of digging through ACF code and building code to extend ACF.
The main issue for not including this in ACF, from my observation, is repeater and flexible content fields (both are repeaters really). Because of the way that ACF manages repeaters it is simply impossible to know match a specific row of a repeater in one post with a specific row of a repeater on another post. Especially considering that rows can be reordered on either side of the relationship.
My assumption for why it was not included in ACF is that the developer did not want to provide the functionality if it could not be done under all conditions… because as soon as it was added there would be demands that it worked under all conditions.
Could ACF add limits to not allow bidirectional fields in repeaters. Possibly, but currently ACF does not really allow different settings for field types dependent on if they are top level fields or sub fields. This could potentially be added. But again, I am assuming this has not been done because when it is done, as mentioned above, the developer would get many requests to make it work for sub fields.
3rd Party plugins can limit how it can be used avoiding the need for the developer to add features that cannot be supported under all conditions. For example the plugin I created that does this only looks at top level fields and avoids the repeater problem by ignoring it completely. This is functionality that I simply refuse to add and consider “Out of Scope”.
The fact that these bidirectional relationships can be coded only limits what they can do to the abilities of the coder. Might it be possible to do bidirectional fields for repeater sub fields? Maybe… for a specific use case, built and coded for that specific use case.
What is the difference between Post Object and Relationship fields?
There are 2 main differences.
I have always used these as 1) Post Object fields always allow only one selection. 2) Relationship fields always allow multiple selections.
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!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz
— Advanced Custom Fields (@wp_acf) March 7, 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.