WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
33 | * The last element in the array should always be the fallback template for this query type. |
34 | * |
35 | * Possible values for `$type` include: 'index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date', |
36 | * 'embed', 'home', 'frontpage', 'page', 'paged', 'search', 'single', 'singular', and 'attachment'. |
37 | * |
38 | * @since 4.7.0 |
39 | * |
40 | * @param array $templates A list of template candidates, in descending order of priority. |
41 | */ |
42 | $templates = apply_filters( "{$type}_template_hierarchy", $templates ); |
43 |
|
44 | $template = locate_template( $templates ); |
45 |
|
46 | /** |
47 | * Filters the path of the queried template by type. |
48 | * |
49 | * The dynamic portion of the hook name, `$type`, refers to the filename -- minus the file |
50 | * extension and any non-alphanumeric characters delimiting words -- of the file to load. |
51 | * This hook also applies to various types of files loaded as part of the Template Hierarchy. |