Changeset 50505 for trunk/src/wp-includes/template.php
- Timestamp:
- 03/07/2021 12:30:38 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/template.php
r48370 r50505 17 17 * @since 1.5.0 18 18 * 19 * @param string $type Filename without extension.20 * @param array $templates An optional list of template candidates19 * @param string $type Filename without extension. 20 * @param string[] $templates An optional list of template candidates. 21 21 * @return string Full path to template file. 22 22 */ … … 31 31 * Filters the list of template filenames that are searched for when retrieving a template to use. 32 32 * 33 * The dynamic portion of the hook name, `$type`, refers to the filename -- minus the file 34 * extension and any non-alphanumeric characters delimiting words -- of the file to load. 33 35 * The last element in the array should always be the fallback template for this query type. 34 36 * 35 * Possible values for `$type` include: 'index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date', 36 * 'embed', 'home', 'frontpage', 'privacypolicy', 'page', 'paged', 'search', 'single', 'singular', and 'attachment'. 37 * Possible hook names include: 38 * 39 * - `404_template_hierarchy` 40 * - `archive_template_hierarchy` 41 * - `attachment_template_hierarchy` 42 * - `author_template_hierarchy` 43 * - `category_template_hierarchy` 44 * - `date_template_hierarchy` 45 * - `embed_template_hierarchy` 46 * - `frontpage_template_hierarchy` 47 * - `home_template_hierarchy` 48 * - `index_template_hierarchy` 49 * - `page_template_hierarchy` 50 * - `paged_template_hierarchy` 51 * - `privacypolicy_template_hierarchy` 52 * - `search_template_hierarchy` 53 * - `single_template_hierarchy` 54 * - `singular_template_hierarchy` 55 * - `tag_template_hierarchy` 56 * - `taxonomy_template_hierarchy` 37 57 * 38 58 * @since 4.7.0 39 59 * 40 * @param array$templates A list of template candidates, in descending order of priority.60 * @param string[] $templates A list of template candidates, in descending order of priority. 41 61 */ 42 62 $templates = apply_filters( "{$type}_template_hierarchy", $templates ); … … 51 71 * This hook also applies to various types of files loaded as part of the Template Hierarchy. 52 72 * 53 * Possible values for `$type` include: 'index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date', 54 * 'embed', 'home', 'frontpage', 'privacypolicy', 'page', 'paged', 'search', 'single', 'singular', and 'attachment'. 73 * Possible hook names include: 74 * 75 * - `404_template` 76 * - `archive_template` 77 * - `attachment_template` 78 * - `author_template` 79 * - `category_template` 80 * - `date_template` 81 * - `embed_template` 82 * - `frontpage_template` 83 * - `home_template` 84 * - `index_template` 85 * - `page_template` 86 * - `paged_template` 87 * - `privacypolicy_template` 88 * - `search_template` 89 * - `single_template` 90 * - `singular_template` 91 * - `tag_template` 92 * - `taxonomy_template` 55 93 * 56 94 * @since 1.5.0 57 95 * @since 4.8.0 The `$type` and `$templates` parameters were added. 58 96 * 59 * @param string $template Path to the template. See locate_template().60 * @param string $type Sanitized filename without extension.61 * @param array$templates A list of template candidates, in descending order of priority.97 * @param string $template Path to the template. See locate_template(). 98 * @param string $type Sanitized filename without extension. 99 * @param string[] $templates A list of template candidates, in descending order of priority. 62 100 */ 63 101 return apply_filters( "{$type}_template", $template, $type, $templates );
Note: See TracChangeset
for help on using the changeset viewer.