[resolved] Language Switcher / Links (3 posts)

  1. Svensson36
    Posted 1 year ago #


    thank you for the great plugin!

    However, I have a problem or maybe it ist just a question. I have a network with two languages (german and english).
    When I am on a page/post in one language and click on the flag to get the page/popst in the corresponding language, everything works fine.

    But when I click on the flag of the language of the current page/post I get to the homepage of the current language (Off course normally you don't have to click on the button of the current language, but users sometimes do strange things ;-) ). Is this how the plugin behaves normally? I would prefer that nothing happens if I click on the flag of the current language. How can I "teach" the plugin to do so?

    Thanks in advance!


  2. toscho
    WCEU 2016 Contributor
    Plugin Author

    Posted 1 year ago #


    this should not happen. Are you using the widget or custom code? You can filter mlp_linked_element_link to change that.


    add_filter( 'mlp_linked_element_link', function( $url, $blog ) {
    	return get_current_blog_id() === $blog ? '' : $url;
    }, 10, 2 );
  3. Svensson36
    Posted 1 year ago #


    thanks a lot for the quick answer!

    This solution worked, thank you! To be honest, this is my first multisite installation and I didn't know that I can use custom code which I normally prefer. So I use the widget.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • MultilingualPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic