not-only-code / qtranslate-slug

Adds support for permalink translations and fix some Qtranslate deficiencies since wordpress 3.0
http://wordpress.org/extend/plugins/qtranslate-slug
46 stars 31 forks source link

Translate support in Custom links in Nav Menus #20

Open not-only-code opened 11 years ago

not-only-code commented 11 years ago

I think andreu is talking about the custom links where you input the links manually. It is not a bug. I assume you just didn't implement the functionality to that feature. However, like andreu said, by manually applying qTranslate's tags (<--:en-->), it will automatically become compatible with the plugin's nav menu translator.

bmachuel commented 7 years ago

@fedenuche

Have you tried to put the code below in your function.php file?

function qtrans_menuitem( $menu_item ) {
   if (stripos($menu_item->url, get_site_url()) !== false){
    $menu_item->url = qtrans_convertURL($menu_item->url);
    }     
return $menu_item;
}

add_filter('wp_setup_nav_menu_item', 'qtrans_menuitem', 0);

Benoît

fedenuche commented 7 years ago

Yes, I tried but it didn't work.