• Resolved vfreriks

    (@vfreriks)


    Hello,

    Is it possible to copy the content of Advanced Custom Fields (specifically the repeater field) in posts to new translations so the original content can be translated without having to add all repeater fields again? Right now the content of the WYSIWYG is copied but not the contents of the repeater fields.

    Thanks in advance!

Viewing 1 replies (of 1 total)
  • Hi there,

    TL;DR: yes, but would have to do it yourself.

    First of all, it’s not about ACF, but Custom Fields in general, so all of them.
    MultilingualPress only takes the default post properties into account (i.e., title, slug, content, excerpt, featured image).

    There are a lot of requests for translation of custom fields (which are, of course, not only interesting for custom post types, but posts and pages as well).
    As of now, this is not possible, though. We are sorry for this, but it has really a lot of reasons. The most important (and obvious) ones being these:

    • we cannot know which of all custom fields should be translatable, and which not;
    • we cannot know about the nature of each field (what’s the allowed data type, are there any conditions to be respected, …);
    • we cannot know about the UI (and cannot rebuild it anyway).

    We really hope to be able to do something to this when the Fields API will get merged into Core – and plugins make use of it. To be honest, though, this might take quite a while to get there.

    What you can do if you are a developer, however, is make use of plugin actions and insert some UI for the custom fields you are interested in yourself – and also take care of processing these.
    Just have a look at the individual actions fired in the meta box and in the processing unit, respectively.

    If all you want is to copy data from one post to another (e.g., settings that are the same in all languages), you can make use of the mlp_pre_save_post_meta filter for that to happen.
    Add an entry for every meta value that you want the translation posts to have, with the key being the according meta key. You can get the original post ID via the second argument that gets passed to the filter (i.e., $save_context['real_post_id']).

    Cheers,
    Thorsten

Viewing 1 replies (of 1 total)

The topic ‘Copy Advanced Custom Fields from source post’ is closed to new replies.