WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. kidd_01
    Member
    Posted 1 year 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.]

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

  2. realloc
    Member
    Plugin Author

    Posted 1 year 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

    Cheers,
    Dennis.

  3. kidd_01
    Member
    Posted 1 year ago #

    Thanks a lot Dennis! Awesome plugin!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.