Support

Account

Home Forums ACF PRO create a translation of a post using

Solved

create a translation of a post using

  • I have a gravity form in English built using ACF fields that when submitted creates a post. I only need to translate some of the ACF fields, the rest I would like to syncronise.

    I want to give the user the option to fill out a second gravity form with the ACF fields I need tranlated. On submit it should create a new post which is a translation of the English one, containing the syncronised ACF fields and the new gravity form fields.
    How do I connect the two forms so one will become a translation of the first?

  • Hi @renar

    I’m not so sure how the saving process in Gravity Form and WPML works, so I’m sorry if I can’t help you much. For something like that, I suggest you consult to their support instead. After you know how to create the translated post using those plugins, then you need to get the translated post ID. By using this ID, you can add the values to the translated post by using the update_field() function.

    I hope this makes sense 🙂

  • The gravity form creates a new custom post type and I can get the ID of this post and other posts written by the same author.
    What hook should I put the update_field in?
    I want the fields to be loaded when I first go in and edit the page, not after I save the post, since a lot of the fields are mandatory and I can’t save the post without filling them out. So add_action(‘acf/save_post’) doesn’t do what I need here.
    What hook should I use?

  • Hi @renar

    I believe you need the hook where the Gravity Form saves the translated post. Unfortunately, I’m not sure which one is it. Please consult to Gravity Form support instead.

    Could you please tell me what did you mean by “I want the fields to be loaded when I first go in and edit the page?” I believe if you set the right location, you’ll see the custom fields on the edit page (backend).

    Hope this makes sense 🙂

  • thanks I’m using the gravity form hook add_action( ‘gform_after_submission’, ‘update_hebrew_acf_fields’, 10, 2 );
    works perfectly.
    Issue solved

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘create a translation of a post using’ is closed to new replies.