Home › Forums › ACF PRO › WPML post duplication + ACF relationship fields › Reply To: WPML post duplication + ACF relationship fields
OK, for those who wants to achieve this, i found a solution which is so far working without a problem :
You’ll need to use ACF post 2 Post (https://wordpress.org/plugins/post-2-post-for-acf/)
ACFP2P have a hook that is called after each related post is updated, all you need to do is to use the WPML hook “wpml_admin_make_post_duplicates” on each posts, thus updating your duplicated post data:
add_action(‘acf/post2post/relationship_updated’, ‘my_post_updated_action’);
function my_post_updated_action($post_id) {
// $post_id == the post ID that was updated
// do something after the related post is updated
do_action( ‘wpml_admin_make_post_duplicates’, $post_id );
}
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.