This thread is resolved. Here is a description of the problem and solution.
Problem: The client is using Advanced Custom Fields (ACF) and has issues with batch-selecting fields for translation using the
acf_add_local_field_group
function. They have successfully implemented the
wpml_cf_preferences
attribute in their local environment as per our documentation, but are facing problems in the development environment where fields are not consistently available for translation, especially with multi-level arrays. They also inquired about reindexing fields to include new fields and troubleshooting the scanning of fields created with PHP.
Solution: 1. We asked the client to check if the fields are now appearing correctly in the Advanced Translation Editor (ATE) by providing a link to a specific post in their development environment. 2. We advised the client to: - Open ATE and complete the translation for fields that were present. - Make a slight change to the original content (e.g., changing the Logo size value). - Resave the original content. This process should make the fields appear if they were added after some translations had already started, as the ACF configuration files would not take effect until the original content is resaved.
If this solution does not seem relevant or if the problem persists, we recommend opening a new support ticket with us for further assistance. You can do so by visiting the WPML support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Our website is based on ACF, we use the `acf_add_local_field_group` function to manage fields, and I'm looking for a way to batch-select all fields for translation.
Indeed, this approach worked in my local environment. However, I'm encountering issues in the development environment where it doesn't seem to function as expected, and I'm unclear about the cause of this problem.
Additionally, looking at the local environment, I noticed that not all fields are being translated, even though I've double-checked their attributes and everything appears correct. Most issues arise with multi-level arrays. For instance:
field-modules_0_module_general_0_columns_0_description is available for translation.
field-modules_1_module_general_0_columns_0_description is omitted.
field-modules_2_module_general_0_columns_0_description is again available for translation.
I've conducted numerous tests but can't pinpoint why this inconsistency occurs. Also, I'm curious about how to initiate a reindexing of fields to include new fields and generally how this reindexing process works.
Additionally, I discovered a setting that allows for scanning fields created with PHP, but unfortunately, this function isn't working for me. Is there a way to troubleshoot or fix this issue?
Any insights or guidance you can provide would be greatly appreciated.
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
Hi,
Thank you for contacting WPML support!
Let's focus on one issue at a time (for our support rules) and we can split the ticket later. When you say:
"However, I'm encountering issues in the development environment where it doesn't seem to function as expected, and I'm unclear about the cause of this problem."
Can you clarify this a bit more, what doesn't work? Is that an issue with multi-level arrays or is this another issue?
Let's start with the local environment, this is my computer where I work with the code. The dev environment is one of the sites we use for testing before uploading to production.
I added wpml_cf_preferences to my ACF file, and it's working on my local env but for some reason doesn’t work on dev env.
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
Can you check now?
hidden link
Open in ATE and check the fields there. Are they appearing now correctly? Can you check for any other page with the same issue?
If so, this is what I have done:
- Opened ATE and completed the translation for 3 fields that were there
- made a slight change the original ( only changing the Logo size value)
- resaved
And now they appear - if this is working in other instances also, the reason is that most likely you added your ACF configuration files after you started some of the translations on this site, so these have not taken effect yet until the original is resaved.
That seems to be it, thanks for the help, I'll get back to you if I have any questions
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.