_block_template_render_title_tag()
云策文档标注
概述
_block_template_render_title_tag() 是一个 WordPress 函数,用于输出文档标题标签,无论主题是否支持 title-tag 功能。
关键要点
- 函数输出文档标题标签,内容来自 wp_get_document_title()。
- 与 _wp_render_title_tag() 相关,但此函数不依赖主题的 title-tag 支持。
- 在 WordPress 5.8.0 版本中引入。
代码示例
function _block_template_render_title_tag() {
echo '<title>' . wp_get_document_title() . '</title>' . "n";
}
原文内容
Displays title tag with content, regardless of whether theme has title-tag support.
Description
See also
Source
function _block_template_render_title_tag() {
echo '<title>' . wp_get_document_title() . '</title>' . "n";
}
Changelog
| Version | Description |
|---|---|
| 5.8.0 | Introduced. |