WordPress.org

Forums

Multilingual Press
[resolved] Language Switcher / Links (3 posts)

  1. Svensson36
    Member
    Posted 9 months ago #

    Hi,

    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!

    https://wordpress.org/plugins/multilingual-press/

  2. toscho
    Member
    Plugin Author

    Posted 9 months ago #

    Hi,

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

    Example:

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

    Hi,

    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.

Reply

You must log in to post.

About this Plugin

  • Multilingual Press
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic