wp-posts-to-posts icon indicating copy to clipboard operation
wp-posts-to-posts copied to clipboard

Update relations with Advanced Custom Fields

Open develop-euro opened this issue 8 years ago • 3 comments

I installed Orbis theme+plugin which brought me to posts to posts. I used ACF (v5) to create a front-end table that displays lots of information about each project and each line (each project) has a form where it's possible to update several fields. One of them should be the relation between projects and persons (two custom post-types). I belive that what I should do is create an action that updates the connections to that post (project) every time the ACF field value is updated. From what I found I can use this to trigger the action when the ACF field is updated . But I have no idea how to do the rest. Any help?

add_filter('acf/update_value/name=person', ...

develop-euro avatar Mar 04 '16 11:03 develop-euro

You'll have to create the connections programmatically https://github.com/scribu/wp-posts-to-posts/wiki/Creating-connections-programmatically

JiveDig avatar Mar 29 '16 15:03 JiveDig

Hi,

I was wondering if you managed to achieve this at all?

I'd like to be able to attach ACF fields to the relationship between 2 posts, but struggling to figure out the best way of doing it, and so far have come up with nothing!

Thanks

scottwvw avatar Jan 21 '20 17:01 scottwvw

If you want to do it all in ACF, then P2P probably isn't what you need. Stick with ACF https://www.advancedcustomfields.com/resources/bidirectional-relationships/

JiveDig avatar Jan 21 '20 19:01 JiveDig