language_attributes

The timeline below displays how wordpress function language_attributes has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.5

/**
 * Displays the language attributes for the 'html' tag.
 *
 * Builds up a set of HTML attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 * @since 4.3.0 Converted into a wrapper for get_language_attributes().
 *
 * @param string $doctype Optional. The type of HTML document. Accepts 'xhtml' or 'html'. Default 'html'.
 */
function language_attributes($doctype = 'html')
{
    echo get_language_attributes($doctype);
}

WordPress Version: 4.3

/**
 * Displays the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 * @since 4.3.0 Converted into a wrapper for get_language_attributes().
 *
 * @param string $doctype Optional. The type of html document. Accepts 'xhtml' or 'html'. Default 'html'.
 */
function language_attributes($doctype = 'html')
{
    echo get_language_attributes($doctype);
}

WordPress Version: 2.4

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: .30

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = 'lang="' . esc_attr($lang) . '"';
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = 'xml:lang="' . esc_attr($lang) . '"';
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: 2.3

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: .20

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = 'lang="' . esc_attr($lang) . '"';
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = 'xml:lang="' . esc_attr($lang) . '"';
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: 2.2

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: .18

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = 'lang="' . esc_attr($lang) . '"';
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = 'xml:lang="' . esc_attr($lang) . '"';
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: 1.5

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: .40

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = 'lang="' . esc_attr($lang) . '"';
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = 'xml:lang="' . esc_attr($lang) . '"';
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: 1.4

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: .30

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = 'lang="' . esc_attr($lang) . '"';
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = 'xml:lang="' . esc_attr($lang) . '"';
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: 1.3

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: .21

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = 'lang="' . esc_attr($lang) . '"';
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = 'xml:lang="' . esc_attr($lang) . '"';
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: 0.4

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: .30

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = 'lang="' . esc_attr($lang) . '"';
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = 'xml:lang="' . esc_attr($lang) . '"';
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: 0.3

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: .21

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = 'lang="' . esc_attr($lang) . '"';
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = 'xml:lang="' . esc_attr($lang) . '"';
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: 4.0

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: 3.9

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    $output = '';
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    /**
     * Filter the language attributes for display in the html tag.
     *
     * @since 2.5.0
     *
     * @param string $output A space-separated list of language attributes.
     */
    echo apply_filters('language_attributes', $output);
}

WordPress Version: 8.4

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    $output = '';
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    $output = apply_filters('language_attributes', $output);
    echo $output;
}

WordPress Version: .30

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    $output = '';
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = 'lang="' . esc_attr($lang) . '"';
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = 'xml:lang="' . esc_attr($lang) . '"';
        }
    }
    $output = implode(' ', $attributes);
    $output = apply_filters('language_attributes', $output);
    echo $output;
}

WordPress Version: 8.3

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    $output = '';
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    $output = apply_filters('language_attributes', $output);
    echo $output;
}

WordPress Version: .24

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    $output = '';
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = 'lang="' . esc_attr($lang) . '"';
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = 'xml:lang="' . esc_attr($lang) . '"';
        }
    }
    $output = implode(' ', $attributes);
    $output = apply_filters('language_attributes', $output);
    echo $output;
}

WordPress Version: 7.5

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    $output = '';
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    $output = apply_filters('language_attributes', $output);
    echo $output;
}

WordPress Version: .40

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    $output = '';
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = 'lang="' . esc_attr($lang) . '"';
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = 'xml:lang="' . esc_attr($lang) . '"';
        }
    }
    $output = implode(' ', $attributes);
    $output = apply_filters('language_attributes', $output);
    echo $output;
}

WordPress Version: 7.4

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    $output = '';
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    $output = apply_filters('language_attributes', $output);
    echo $output;
}

WordPress Version: .30

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    $output = '';
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = 'lang="' . esc_attr($lang) . '"';
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = 'xml:lang="' . esc_attr($lang) . '"';
        }
    }
    $output = implode(' ', $attributes);
    $output = apply_filters('language_attributes', $output);
    echo $output;
}

WordPress Version: 7.3

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    $output = '';
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    $output = apply_filters('language_attributes', $output);
    echo $output;
}

WordPress Version: .24

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    $output = '';
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = 'lang="' . esc_attr($lang) . '"';
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = 'xml:lang="' . esc_attr($lang) . '"';
        }
    }
    $output = implode(' ', $attributes);
    $output = apply_filters('language_attributes', $output);
    echo $output;
}

WordPress Version: 3.7

/**
 * Display the language attributes for the html tag.
 *
 * Builds up a set of html attributes containing the text direction and language
 * information for the page.
 *
 * @since 2.1.0
 *
 * @param string $doctype The type of html document (xhtml|html).
 */
function language_attributes($doctype = 'html')
{
    $attributes = array();
    $output = '';
    if (function_exists('is_rtl') && is_rtl()) {
        $attributes[] = 'dir="rtl"';
    }
    if ($lang = get_bloginfo('language')) {
        if (get_option('html_type') == 'text/html' || $doctype == 'html') {
            $attributes[] = "lang=\"{$lang}\"";
        }
        if (get_option('html_type') != 'text/html' || $doctype == 'xhtml') {
            $attributes[] = "xml:lang=\"{$lang}\"";
        }
    }
    $output = implode(' ', $attributes);
    $output = apply_filters('language_attributes', $output);
    echo $output;
}