WordPress.org

Make WordPress Core

Changeset 40964


Ignore:
Timestamp:
06/29/2017 04:04:45 PM (3 years ago)
Author:
DrewAPicture
Message:

Docs: Don't reference non-existent hooks inline in the DocBlock descriptions for the following template functions:

  • get_index_template()
  • get_404_template()
  • get_author_template()
  • get_category_template()
  • get_tag_template()
  • get_taxonomy_template()
  • get_date_template()
  • get_home_template()
  • get_front_page_template()
  • get_page_template()
  • get_search_template()
  • get_single_template()
  • get_embed_template()
  • get_singular_template()
  • get_attachment_template()

As mentioned when these dynamic hook references were originally fixed in [33274], we can't link to non-existent hooks inline because the Code Reference auto-linker won't pick up on the dynamic-ness of the hook, it'll just try to link to a hook reference that doesn't exist. In these cases, we need to be generic and provide context for the value of $type.

See [38418] for where the original fix was reversed. See this changeset for reversing the reversal.

Props donutz, milana_cap.

Fixes #41198.

File:
1 edited

Legend:

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

    r40963 r40964  
    6666 * Retrieve path of index template in current or parent template.
    6767 *
    68  * The template hierarchy is filterable via the {@see 'index_template_hierarchy'} hook.
    69  * The template path is filterable via the {@see 'index_template'} hook.
     68 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     69 * and {@see '$type_template'} dynamic hooks, where `$type` is 'index'.
    7070 *
    7171 * @since 3.0.0
     
    8282 * Retrieve path of 404 template in current or parent template.
    8383 *
    84  * The template hierarchy is filterable via the {@see '404_template_hierarchy'} hook.
    85  * The template path is filterable via the {@see '404_template'} hook.
     84 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     85 * and {@see '$type_template'} dynamic hooks, where `$type` is '404'.
    8686 *
    8787 * @since 1.5.0
     
    161161 * 3. author.php
    162162 *
    163  * The template hierarchy is filterable via the {@see 'author_template_hierarchy'} hook.
    164  * The template path is filterable via the {@see 'author_template'} hook.
     163 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     164 * and {@see '$type_template'} dynamic hooks, where `$type` is 'author'.
    165165 *
    166166 * @since 1.5.0
     
    199199 * 3. category.php
    200200 *
    201  * The template hierarchy is filterable via the {@see 'category_template_hierarchy'} hook.
    202  * The template path is filterable via the {@see 'category_template'} hook.
     201 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     202 * and {@see '$type_template'} dynamic hooks, where `$type` is 'category'.
    203203 *
    204204 * @since 1.5.0
     
    245245 * 3. tag.php
    246246 *
    247  * The template hierarchy is filterable via the {@see 'tag_template_hierarchy'} hook.
    248  * The template path is filterable via the {@see 'tag_template'} hook.
     247 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     248 * and {@see '$type_template'} dynamic hooks, where `$type` is 'tag'.
    249249 *
    250250 * @since 2.3.0
     
    291291 * 3. taxonomy.php
    292292 *
    293  * The template hierarchy is filterable via the {@see 'taxonomy_template_hierarchy'} hook.
    294  * The template path is filterable via the {@see 'taxonomy_template'} hook.
     293 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     294 * and {@see '$type_template'} dynamic hooks, where `$type` is 'taxonomy'.
    295295 *
    296296 * @since 2.5.0
     
    326326 * Retrieve path of date template in current or parent template.
    327327 *
    328  * The template hierarchy is filterable via the {@see 'date_template_hierarchy'} hook.
    329  * The template path is filterable via the {@see 'date_template'} hook.
     328 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     329 * and {@see '$type_template'} dynamic hooks, where `$type` is 'date'.
    330330 *
    331331 * @since 1.5.0
     
    342342 * Retrieve path of home template in current or parent template.
    343343 *
    344  * The template hierarchy is filterable via the {@see 'home_template_hierarchy'} hook.
    345  * The template path is filterable via the {@see 'home_template'} hook.
     344 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     345 * and {@see '$type_template'} dynamic hooks, where `$type` is 'home'.
    346346 *
    347347 * @since 1.5.0
     
    360360 * Retrieve path of front page template in current or parent template.
    361361 *
    362  * The template hierarchy is filterable via the {@see 'frontpage_template_hierarchy'} hook.
    363  * The template path is filterable via the {@see 'frontpage_template'} hook.
     362 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     363 * and {@see '$type_template'} dynamic hooks, where `$type` is 'frontpage'.
    364364 *
    365365 * @since 3.0.0
     
    392392 * 4. page.php
    393393 *
    394  * The template hierarchy is filterable via the {@see 'page_template_hierarchy'} hook.
    395  * The template path is filterable via the {@see 'page_template'} hook.
     394 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     395 * and {@see '$type_template'} dynamic hooks, where `$type` is 'page'.
    396396 *
    397397 * @since 1.5.0
     
    435435 * Retrieve path of search template in current or parent template.
    436436 *
    437  * The template hierarchy is filterable via the {@see 'search_template_hierarchy'} hook.
    438  * The template path is filterable via the {@see 'search_template'} hook.
     437 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     438 * and {@see '$type_template'} dynamic hooks, where `$type` is 'search'.
    439439 *
    440440 * @since 1.5.0
     
    466466 * 4. single.php
    467467 *
    468  * The template hierarchy is filterable via the {@see 'single_template_hierarchy'} hook.
    469  * The template path is filterable via the {@see 'single_template'} hook.
     468 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     469 * and {@see '$type_template'} dynamic hooks, where `$type` is 'single'.
    470470 *
    471471 * @since 1.5.0
     
    519519 * 3. embed.php
    520520 *
    521  * The template hierarchy is filterable via the {@see 'embed_template_hierarchy'} hook.
    522  * The template path is filterable via the {@see 'embed_template'} hook.
     521 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     522 * and {@see '$type_template'} dynamic hooks, where `$type` is 'embed'.
    523523 *
    524524 * @since 4.5.0
     
    549549 * Retrieves the path of the singular template in current or parent template.
    550550 *
    551  * The template hierarchy is filterable via the {@see 'singular_template_hierarchy'} hook.
    552  * The template path is filterable via the {@see 'singular_template'} hook.
     551 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     552 * and {@see '$type_template'} dynamic hooks, where `$type` is 'singular'.
    553553 *
    554554 * @since 4.3.0
     
    579579 * 4. attachment.php
    580580 *
    581  * The template hierarchy is filterable via the {@see 'attachment_template_hierarchy'} hook.
    582  * The template path is filterable via the {@see 'attachment_template'} hook.
     581 * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
     582 * and {@see '$type_template'} dynamic hooks, where `$type` is 'attachment'.
    583583 *
    584584 * @since 2.0.0
Note: See TracChangeset for help on using the changeset viewer.