scribu / wp-posts-to-posts

Efficient many-to-many connections between posts, pages, custom post types, users.
http://wordpress.org/plugins/posts-to-posts/
974 stars 260 forks source link

Update relations with Advanced Custom Fields #521

Open develop-euro opened 8 years ago

develop-euro commented 8 years ago

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', ...

JiveDig commented 8 years ago

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

scottwvw commented 4 years ago

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

JiveDig commented 4 years ago

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/