WordPress.org

Forums

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

  1. topatidle
    Member
    Posted 3 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. Dennis Ploetner
    Member
    Plugin Author

    Posted 3 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 3 years ago #

    Thanks,

    I'll give it a try,

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