apply_filters( "{$type}_template", string $template , string $type , string[] $templates )
Filters the path of the queried template by type.
Description
The dynamic portion of the hook name, $type, refers to the filename — minus the file extension and any non-alphanumeric characters delimiting words — of the file to load.
This hook also applies to various types of files loaded as part of the Template Hierarchy.
Possible hook names include:
404_templatearchive_templateattachment_templateauthor_templatecategory_templatedate_templateembed_templatefrontpage_templatehome_templateindex_templatepage_templatepaged_templateprivacypolicy_templatesearch_templatesingle_templatesingular_templatetag_templatetaxonomy_template
Parameters
- $template
-
Path to the template. See locate_template().
- $type
-
Sanitized filename without extension.
- $templates
-
A list of template candidates, in descending order of priority.
Source
File: wp-includes/template.php
Changelog
| Version | Description |
|---|---|
| 4.8.0 | The $type and $templates parameters were added. |
| 1.5.0 | Introduced. |