This thread is resolved. Here is a description of the problem and solution.
Problem:
After installing WPML on a WordPress site using the Divi theme, the client is unable to use the translation management view to automatically translate content, as page created with Divi have a lot of content global_colors_info.
Solution:
We recommend the following workaround:
1. Backup the website or create a backup of the problematic page.
2. Add the following code to the
functions.php
file of your theme:
// WPML Workaround for compsupp-7144 function wpml_compsupp7144_clear_global_colors_info_attribute($post_id) { $post_content = get_post_field('post_content', $post_id); $pattern = '/(\[.*?global_colors_info=")([^\"]*)(\"[^\]]*\])/' $new_content = preg_replace_callback( $pattern, function ($matches) { return $matches[1] . '' . $matches[3]; }, $post_content ); if ($new_content !== $post_content) { $updated_post = array( 'ID' => $post_id, 'post_content' => $new_content, ); wp_update_post($updated_post); } } wpml_compsupp7144_clear_global_colors_info_attribute(999999); // Replace 999999 with your post ID
3. Replace
999999
with the post ID of the page you're having issues with.
4. Visit the page on the front-end to execute the code.
5. Comment out the last line of the snippet after the code has run.
This will remove the content of all
global_colors_info
attributes from the page, allowing you to translate the page using the Classic Translation Editor (CTE) or Advanced Translation Editor (ATE).
If this solution doesn't seem relevant to your issue, please open a new support ticket with us.
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.
This topic contains 14 replies, has 2 voices.
Last updated by 1 year, 4 months ago.
Assisted by: Dražen.