WPML does not register custom fields for translation
- This topic has 7 replies, 2 voices, and was last updated 3 years, 9 months ago by
VoB.
-
AuthorPosts
-
July 16, 2021 at 1:36 AM #29537
VoB
ParticipantHi!
I have followed this article to enable translation for MP managed custom fields:
https://metabox.io/translate-custom-fields-with-wpml/I still cannot see those fields added for translation.
July 16, 2021 at 1:37 AM #29538VoB
Participant<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'VoB Source for Article', 'your-text-domain' ), 'id' => 'vob-source-for-article', 'post_types' => ['vob-post-article'], 'storage_type' => 'custom_table', 'table' => 'wp_custom_vob_source_for_article', 'context' => 'side', 'priority' => 'high', 'fields' => [ [ 'name' => __( 'Source Name Tag', 'your-text-domain' ), 'id' => $prefix . 'vob_article_source_name_tag', 'type' => 'taxonomy_advanced', 'label_description' => __( 'Name of the publisher or web-site from taxonomy', 'your-text-domain' ), 'taxonomy' => ['vob_source_name_tag'], 'field_type' => 'select', 'placeholder' => __( 'Select source name from the list', 'your-text-domain' ), 'add_new' => true, ], [ 'name' => __( 'Source Name', 'your-text-domain' ), 'id' => $prefix . 'vob_article_source_name', 'type' => 'text', 'label_description' => __( 'Name of the publisher or web-site', 'your-text-domain' ), 'placeholder' => __( 'Or add name of the publisher or web-site here', 'your-text-domain' ), ], [ 'name' => __( 'Source URL', 'your-text-domain' ), 'id' => $prefix . 'vob_article_source_url', 'type' => 'url', 'label_description' => __( 'Link to content source', 'your-text-domain' ), 'placeholder' => __( 'Add source URL', 'your-text-domain' ), ], [ 'name' => __( 'Journalist / Author', 'your-text-domain' ), 'id' => $prefix . 'vob_article_source_author', 'type' => 'text', 'label_description' => __( 'Original article author name', 'your-text-domain' ), 'placeholder' => __( 'Add article author', 'your-text-domain' ), ], ], 'validation' => [ 'rules' => [ $prefix . 'vob_article_source_url' => [ 'required' => true, 'url' => true, ], ], ], ]; return $meta_boxes; }
July 16, 2021 at 10:32 AM #29540Long Nguyen
ModeratorHi,
WPML searches the meta key (field ID) in the default WordPress table
wp_postmeta
to translate. So it does not work with the custom table. You can refer to these topics to translate custom fields that stored in the custom table
https://wpml.org/forums/topic/content-in-custom-tables/
https://wpml.org/forums/topic/translating-custom-database-tables-nivo-slider-for-wordpress-v033/July 16, 2021 at 11:52 AM #29543VoB
ParticipantI saw those answers, but (1) they are old and (2) I use taxonomy advanced custom field for which Meta box has a special way of saving in DB. I was hoping to get some directions from Meta Box on this issue as it is claimed as 100% compatible with WPML.
Custom tables for custom fields is one of Meta Box feature and there is no warning about any incompatibility with WPML for this feature. Translating custom fields via WPML strings feature is very inconvenient.
Thanks!
July 16, 2021 at 9:09 PM #29551Long Nguyen
ModeratorThanks for the feedback.
I'm going to inform the developer team to consider adding it to the to-do list for the future development of the plugin.
July 17, 2021 at 8:32 AM #29554VoB
ParticipantGreat, thank a lot for your support! Is there any expected time to get this issue addressed?
July 29, 2021 at 11:27 AM #29753VoB
ParticipantHi Long! I wonder if you have any updates on this request. Thank you!
August 11, 2021 at 12:53 PM #30139VoB
ParticipantHi! Is there any update on this issue? Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.