function uls_language_selector_shortcode($atts)
{
    extract(shortcode_atts(array('url' => null, 'type' => 'links', 'url_type' => 'prefix', 'only_language' => true, 'class' => null), $atts));
    //if URL is null, then it uses the current URL
    if (null == $url) {
        $url = uls_get_browser_url();
    }
    if ("false" == $only_language) {
        $only_language = false;
    }
    return uls_language_link_switch($url, $url_type, $type, $only_language, $class);
}
Example #2
0
function uls_language_selector_shortcode($atts)
{
    extract(shortcode_atts(array('url' => null, 'type' => 'links', 'url_type' => 'prefix', 'only_language' => true, 'class' => null), $atts));
    //if URL is null, then it uses the current URL
    if (null == $url) {
        $url = isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on" ? "https://" : "http://";
        $url .= $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
    }
    if ("false" == $only_language) {
        $only_language = false;
    }
    return uls_language_link_switch($url, $url_type, $type, $only_language, $class);
}