{$type}_template_hierarchy
过滤钩子
apply_filters( "{$type}_template_hierarchy", $templates )
- 参数
-
-
(string[])
$templates
A list of template candidates, in descending order of priority.- Required: 是
-
(string[])
- 定义位置
-
-
wp-includes/template.php
, line 62
-
wp-includes/template.php
- 引入
- 4.7.0
- 弃用
- –
过滤在检索使用的模板时搜索到的模板文件名的列表。
钩子名称的动态部分,$type
,指的是要加载的文件的文件名–减去文件扩展名和任何非字母数字的字符分隔词–。数组中的最后一个元素应该始终是该查询类型的后备模板。
可能的钩子名称包括:
404_template_hierarchy
archive_template_hierarchy
attachment_template_hierarchy
author_template_hierarchy
category_template_hierarchy
date_template_hierarchy
embed_template_hierarchy
frontpage_template_hierarchy
home_template_hierarchy
index_template_hierarchy
page_template_hierarchy
paged_template_hierarchy
privacypolicy_template_hierarchy
search_template_hierarchy
single_template_hierarchy
singular_template_hierarchy
tag_template_hierarchy
taxonomy_template_hierarchy
$templates = apply_filters( "{$type}_template_hierarchy", $templates );
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。