Make WordPress Core


Ignore:
Timestamp:
07/14/2015 10:26:32 PM (9 years ago)
Author:
DrewAPicture
Message:

Docs: Update the DocBlock descriptions for a variety of template functions to better reflect that the dynamic $type_template hook can be used to filter the template path.

It's important to reference the actual dynamic hook name instead of an alias for purposes of auto-linking in the Code Reference.

Affects the docs for:

  • get_index_template()
  • get_404_template()
  • get_archive_template()
  • get_post_type_archive_template()
  • get_author_template()
  • get_category_template()
  • get_tag_template()
  • get_taxonomy_template()
  • get_date_template()
  • get_home_template()
  • get_page_template()
  • get_paged_template()
  • get_search_template()
  • get_single_template()
  • get_singular_template()
  • get_attachment_template()

See #32246.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/template.php

    r33273 r33274  
    4646 * Retrieve path of index template in current or parent template.
    4747 *
    48  * The template path is filterable via the 'index_template' hook.
     48 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     49 * e.g. 'index_template'.
    4950 *
    5051 * @since 3.0.0
     
    6162 * Retrieve path of 404 template in current or parent template.
    6263 *
    63  * The template path is filterable via the '404_template' hook.
     64 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     65 * e.g. '404_template'.
    6466 *
    6567 * @since 1.5.0
     
    7678 * Retrieve path of archive template in current or parent template.
    7779 *
    78  * The template path is filterable via the 'archive_template' hook.
     80 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     81 * e.g. 'archive_template'.
    7982 *
    8083 * @since 1.5.0
     
    101104 * Retrieve path of post type archive template in current or parent template.
    102105 *
    103  * The template path is filterable via the 'archive_template' hook.
     106 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     107 * e.g. 'archive_template'.
    104108 *
    105109 * @since 3.7.0
     
    124128 * Retrieve path of author template in current or parent template.
    125129 *
    126  * The template path is filterable via the 'author_template' hook.
     130 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     131 * e.g. 'author_template'.
    127132 *
    128133 * @since 1.5.0
     
    149154 * Retrieve path of category template in current or parent template.
    150155 *
    151  * Works by first retrieving the current slug, for example 'category-default.php', and then
    152  * trying category ID, for example 'category-1.php', and will finally fall back to category.php
    153  * template, if those files don't exist.
    154  *
    155  * The template path is filterable via the 'category_template' hook.
     156 * Works by first retrieving the current slug, for example 'category-default.php',
     157 * and then trying category ID, for example 'category-1.php', and will finally fall
     158 * back to category.php template, if those files don't exist.
     159 *
     160 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     161 * e.g. 'category_template'.
    156162 *
    157163 * @since 1.5.0
     
    178184 * Retrieve path of tag template in current or parent template.
    179185 *
    180  * Works by first retrieving the current tag name, for example 'tag-wordpress.php', and then
    181  * trying tag ID, for example 'tag-1.php', and will finally fall back to tag.php
    182  * template, if those files don't exist.
    183  *
    184  * The template path is filterable via the 'tag_template' hook.
     186 * Works by first retrieving the current tag name, for example 'tag-wordpress.php',
     187 * and then trying tag ID, for example 'tag-1.php', and will finally fall back to
     188 * tag.php template, if those files don't exist.
     189 *
     190 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     191 * e.g. 'tag_template'.
    185192 *
    186193 * @since 2.3.0
     
    216223 * index.php.
    217224 *
    218  * The template path is filterable via the 'taxonomy_template' hook.
     225 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     226 * e.g. 'taxonomy_template'.
    219227 *
    220228 * @since 2.5.0
     
    242250 * Retrieve path of date template in current or parent template.
    243251 *
    244  * The template path is filterable via the 'date_template' hook.
     252 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     253 * e.g. 'date_template'.
    245254 *
    246255 * @since 1.5.0
     
    260269 * Attempts to locate 'home.php' first before falling back to 'index.php'.
    261270 *
    262  * The template path is filterable via the 'home_template' hook.
     271 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     272 * e.g. 'home_template'.
    263273 *
    264274 * @since 1.5.0
     
    299309 * and finally 'page.php'.
    300310 *
    301  * The template path is filterable via the 'page_template' hook.
     311 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     312 * e.g. 'page_template'.
    302313 *
    303314 * @since 1.5.0
     
    334345 * Retrieve path of paged template in current or parent template.
    335346 *
    336  * The template path is filterable via the 'paged_template' hook.
     347 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     348 * e.g. 'paged_template'.
    337349 *
    338350 * @since 1.5.0
     
    349361 * Retrieve path of search template in current or parent template.
    350362 *
    351  * The template path is filterable via the 'search_template' hook.
     363 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     364 * e.g. 'search_template'.
    352365 *
    353366 * @since 1.5.0
     
    364377 * Retrieve path of single template in current or parent template.
    365378 *
    366  * The template path is filterable via the 'single_template' hook.
     379 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     380 * e.g. 'single_template'.
    367381 *
    368382 * @since 1.5.0
     
    387401 * Retrieves the path of the singular template in current or parent template.
    388402 *
    389  * The template path is filterable via the {@see 'singular_template'} hook.
     403 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     404 * e.g. 'singular_template'.
    390405 *
    391406 * @since 4.3.0
     
    410425 * finally 'text-plain.php'.
    411426 *
    412  * The template path is filterable via the 'attachment_template' hook.
     427 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     428 * e.g. 'attachment_template'.
    413429 *
    414430 * @since 2.0.0
Note: See TracChangeset for help on using the changeset viewer.