Support

Account

Home Forums ACF PRO WPML and repeater field

Solving

WPML and repeater field

  • I have a repeater field for a custom post type. Each row has a select list that saves an ID for the post selected. My issue comes when I import translations back into the site. If I have the main repeater field set to copy on the multilingual content setup tab in WPML and not the children fields, it create the rows but there are no values. I have to select each child field that belongs to the main repeater, however the problem there is that more repeaters can be added at anytime, and then I would have to constantly update the settings which is not ideal at all. I would think that by setting the main repeater field to copy, it would carry through to the children fields as well.

    I’m reaching out to ACF first, becuase WPML will just tell me ACF is not a compatible plugin, and ask me if I can use a different one…

  • Bumping for you, I have the same issue.
    I have a repeater field “slides” which has image fields. If I set slides to copy it creates the fields but doesn’t copy over the image field data. Not unless I set each image field to copy, not ideal when setting up for a client.
    I’ve put a ticket in with wpml, gave them access to my dev site but haven’t heard back yet.
    In my case I’ve resorted to using the gallery custom field, but that’s no good for repeaters that aren’t images.

  • I’m not familiar with WPML and the information here, including solutions to previous questions on WPML and ACF are pretty scarce.

    With that said, if either of you figure this out it would be great if you post the solution. I can’t tell you exactly how to solve this issue but I might be able to help you look for a solution by going over the steps I’d take if I needed to figure this out.

    I took a look at the WPML hook reference https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/ and found nothing that appears to let you filter the list of fields that should be copied.

    The first thing I’d do is look for a filter of some kind in the WPML code that might possibly let you filter the list of fields to be copied. Most plugins, especially large plugins, have many filters that are not included in any documentation and the only way to find them is to dig around in the code.

    If there isn’t an existing filter then the next step I’d take is to dig around in the database to figure out where the information is stored. Knowing where it’s stored may actually help you find a hook to filter that information.

    With either a hook or knowing where and how the information is stored I would then create an acf/save_post filter. In this filter I would check the repeater fields that you want to duplicate and how many rows they have. I would compare that with the information already stored in WPML and one way or another update that information in the database.

    If you can locate a hook and supply information on it, or you can locate the information and how it’s stored then I can probably help you figure out the ACF side of the equation to update the data.

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

The topic ‘WPML and repeater field’ is closed to new replies.