1. 首页
  2. WordPress 函数手册

language_attributes()

language_attributes( string $doctype = ‘html’ )

显示html标记的语言属性。
Displays the language attributes for the html tag.

目录锚点:#说明#参数#返回#源码#笔记


说明(Description)

建立一组html属性,其中包含页面的文本方向和语言信息。


参数(Parameters)

参数 类型 必填 说明
$doctype (string) 可选 html文档的类型。接受“xhtml”或“html”。

返回(Return)

无返回值


源码(Source)

/**
 * 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 );
}
更新版本 源码位置 使用 被使用
4.3.0 wp-includes/general-template.php:3984 3 1 function

笔记(Notes)

例子

language_attributes() 为WP2原创文章,链接:https://www.wp2.cn/functions/language_attributes/