Support

Account

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 );
    }