WordPress.org

Ready to get started?Download WordPress

Forums

Multisite Language Switcher
[resolved] Get language of viewed page (3 posts)

  1. topatidle
    Member
    Posted 2 years ago #

    Hi,

    Is there a function I can call to get the language of the page the user is currently viewing?
    For example:
    if(msls_get_current_languange() == 'en_US') {
    // do something
    }else {
    // do something else
    }

    Thanks.

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

  2. realloc
    Member
    Plugin Author

    Posted 2 years ago #

    Yes, you can use something like this:

    $blog     = MslsBlogCollection::instance()->get_current_blog();
    $language = $blog->get_language();

    Cheers,
    Dennis.

  3. topatidle
    Member
    Posted 2 years ago #

    Thanks,

    I'll give it a try,

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic