Custom Fields
Support MB Custom Post Type Translate CPT selection in posts with Polylang

  • Creator
  • #24458
    Resolved Openstream Internet Solutions

    Hi there.
    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 which points me to
    I created a wpml-config.xml file with this content:

        <custom-field action="translate">exhibitor</custom-field>

    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!

Viewing 1 replies (of 1 total)
  • Author
  • #24466
    Long Nguyen


    Please take a look at my screen record

    The custom field post is translated as well even I do not use the file wpml-config.xml. Can you please take a screen record if the field cannot be translated?

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.