Support » Plugin: Multisite Language Switcher » switcher in menu

  • Resolved kidd_01

    (@kidd_01)


    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.]

    http://wordpress.org/extend/plugins/multisite-language-switcher/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘switcher in menu’ is closed to new replies.