Mqtranslate plugin and taxonomies (post category)

Mqtranslate plugin and taxonomies (post category)

Posted: 10 years ago in 


Mqtranslate is useful plugin for post/page translation. However, by default, taxonomies is not detected and hence, there is only one field to input title (according to default language). I found solution of efoula with a minor changes. You can put this code into functions.php of your theme or create a plugin.


Mqtranslate is useful plugin for post/page translation. However, by default, taxonomies is not detected and hence, there is only one field to input title (according to default language). I found solution of efoula with a minor changes. You can put this code into functions.php of your theme or create a plugin.

    function qtranslate_edit_taxonomies(){
       $args=array(
          'public' => true ,
          '_builtin' => false
       );
       $output = 'object'; // or objects
       $operator = 'and'; // 'and' or 'or'
       $taxonomies = get_taxonomies($args,$output,$operator);
       if  ($taxonomies) {
         foreach ($taxonomies  as $taxonomy ) {
             add_action( $taxonomy->name.'_add_form', 'qtrans_modifyTermFormFor');
             add_action( $taxonomy->name.'_edit_form', 'qtrans_modifyTermFormFor');        
         }
       }
    }
    add_action('admin_init', 'qtranslate_edit_taxonomies');

Go to your post category and you will see fields according to enabled languages

Multilingual Post Category using mqtranslate
Multilingual Post Category using mqtranslate


    Tags: