document_title_parts
apply_filters( ‘document_title_parts’, array $title )
过滤钩子:过滤文档标题的部分。
Filter Hook: Filters the parts of the document title.
参数(Parameters)
参数 | 类型 | 说明 |
---|---|---|
$title | (array) | 文件标题部分title’(string)已查看页面的标题。 |
‘page'(string) Optional. Page number if paginated. | ‘tagline’(string) Optional. Site description when on home page. | “site”(字符串)可选。不在主页上时的网站标题。 |
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
4.4.0 | wp-includes/general-template.php:1136 | 1 | 0 |
笔记(Notes)
如果为模板文件添加标题筛选器,请确保add_filter()位于模板文件中的get_header()之前。
更改特定页ID的标题:
document_title_parts 为WP2原创文章,链接:https://www.wp2.cn/hook/document_title_parts/