language_attributes() WordPress Function

The language_attributes() function is used to retrieve the language attributes for the current page. This function is used by the wp_head() function to output the necessary meta tags in the head section of the page.

language_attributes( string $doctype = 'html' ) #

Displays the language attributes for the ‘html’ tag.


Description

Builds up a set of HTML attributes containing the text direction and language information for the page.


Top ↑

Parameters

$doctype

(string)(Optional) The type of HTML document. Accepts 'xhtml' or 'html'.

Default value: 'html'


Top ↑

Source

File: wp-includes/general-template.php

function language_attributes( $doctype = 'html' ) {
	echo get_language_attributes( $doctype );
}


Top ↑

Changelog

Changelog
VersionDescription
4.3.0Converted into a wrapper for get_language_attributes().
2.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More