Home › Forums › ACF PRO › Bidirectional Relationship, different field names, with get/update fields only › Reply To: Bidirectional Relationship, different field names, with get/update fields only
Didn’t see this until now, glad you got it working.
If you are talking about this example: https://github.com/Hube2/acf-filters-and-functions/blob/master/acf-reciprocal-relationship. Yes, I do have a tendency to use WP function, I’m not exactly sure why I did so in the example since ACF must be running to for the filter to work. The only thing that I can thing of was that I was thinking about if the fields are not set already which would cause update_field() using the field name to fail. I also wanted to get raw array values. This could all be rewritten using ACF field functions if the field key is uses for getting and updating and when getting values if you supply the 3rd parameter get_field('field_key', $post_id, false);
I’ll look at doing this if I get some time and I remember.
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.