-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WPML compatability #1251
Comments
/** WPML Workaround for compsupp-7642 - Part 1*/add_filter('wpml_filter_field_value', 'wpml_compsupp7642_workaround_for_serialized_post_meta'); function wpml_compsupp7642_workaround_for_serialized_post_meta($field_value) { if (!is_array($field_value)) { return $field_value; } foreach ($field_value as &$single_value) { if (!is_array($single_value)) { continue; } foreach ($single_value as &$value) { if (!is_string($value)) { continue; } if (is_serialized($value)) { $unserialized = @unserialize($value); if ($unserialized !== false) { $value = is_array($unserialized) ? reset($unserialized) : $unserialized; } } } } return $field_value;} Problem:
function wpml_compsupp7642_workaround_for_serialized_post_meta($field_value) {
} $crb_page_faq_1_title = carbon_get_post_meta($page_id, 'crb_page_faq_1_title'); $crb_page_faq_1_cards = apply_filters('wpml_filter_field_value', carbon_get_post_meta($page_id, 'crb_page_faq_1_cards')); This solution might be outdated or not applicable to your specific case. If these steps do not resolve your issue, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket. |
Version
Expected Behavior
Container::make('post_meta', __('HTML body post')) ->where( 'post_type', 'IN', array('blog')) ->where('post_template', 'IN', array( 'single-blog.php' )) ->add_fields( array( Field::make( 'complex', 'crb_blog_html_body', __( 'Blog html body' ) ) ->add_fields( array( Field::make( 'rich_text', 'html_block', __( 'Html block' ) ), )), Field::make( 'text', 'crb_blog_faq_title', __( 'Title FAQ' ) ), Field::make( 'complex', 'crb_blog_faq_cards', __( 'Blog FAQ cards' ) ) ->add_fields( array( Field::make( 'text', 'title', __( 'Title' ) ), Field::make( 'text', 'subtitle', __( 'Subtitle' ) ) )), ));
How to properly configure translation via wpml carbon fields ?
https://prnt.sc/lS13t28Uz8hr
The wpml support asked me to contact you directly. The original plan was to specify a “copy” for the main repeater Field::make( 'complex', 'crb_blog_html_body', __( 'Blog html body' ) ) but as you can see on the screenshot it is not present
PS In the wml editor itself you can see all the fields, I've even translated them already. But the repeater fields are still not displayed on the page, in the admin they are also not shown for the translated locale
The text was updated successfully, but these errors were encountered: