Multisite Language Switcher
[resolved] switcher in menu (3 posts)

  1. kidd_01
    Posted 3 years ago #

    hi, i used your code to insert the switcher in my main menu. It work fine, thanks. I want to know if it's possible just to add text instead of the 2 flags? Right now, i have the french and us flag. I would like to have only the word english to go to the english part and french to go to the french part.

    Thanks a lot!

    here is the code i used:

    // Add switcher to menu
    function my_custom_menu_item( $items, $args ) {
        if (
            class_exists( 'MslsOutput' ) &&
            'primary-menu' == $args->theme_location
        ) {
            $obj = new MslsOutput;
            $arr = $obj->get( 2 );
            if ( !empty( $arr ) ) {
                $items .= '
    <li>' . implode( '</li>
    <li>', $arr ) . '</li>
        return $items;
    add_filter( 'wp_nav_menu_items', 'my_custom_menu_item', 10, 2 );

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]


  2. Dennis Ploetner
    Plugin Author

    Posted 3 years ago #

    Thanks for your question. I added a list with the possible values here: https://github.com/lloc/Multisite-Language-Switcher/wiki/Generate-the-output


  3. kidd_01
    Posted 3 years ago #

    Thanks a lot Dennis! Awesome plugin!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Multisite Language Switcher
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.