- This topic has 1 reply, 2 voices, and was last updated 5 months, 2 weeks ago by .
I have a custom post type and added to posts a meta box where I can select the CPT. This is my code:
// Selection for exhibitor on admin posts page $meta_boxes = [ 'title' => esc_html__( 'Exhibitor', 'ex' ), 'id' => 'exhibitor', 'post_types' => ['post'], 'context' => 'side', 'priority' => 'low', 'autosave' => true, 'fields' => [ [ 'name' => esc_html__( 'Assigned exhibitor', 'ex' ), 'id' => 'exhibitor', 'type' => 'post', 'post_type' => 'exhibitor', 'field_type' => 'select_advanced', 'placeholder' => esc_html__( 'Select an exhibitor', 'ex' ), 'query_args' => array( 'post_status' => 'publish', 'posts_per_page' => - 1, ), 'ajax' => true ] ] ];
I do also use Polylang to translate the content.
I want to make sure the selected CPT (in my case the exhibitor) it is "translated". It is not working out of the box. I found this topic https://wordpress.org/support/topic/metabox-and-polyang/ which points me to https://wpml.org/documentation/support/language-configuration-files/.
I created a wpml-config.xml file with this content:
<wpml-config> <custom-fields> <custom-field action="translate">exhibitor</custom-field> </custom-fields> </wpml-config>
But, I do not get the field translated.
There are several questions:
1.) Is the file correct?
2.) Where Do I habe to store the file? In the plugin directory, which is setting up the meta box or, in the theme directory?
Thank you for your reply!
- You must be logged in to reply to this topic.