[wp-trac] [WordPress Trac] #41198: Reference dynamic hooks in doc blocks, e.g. archive_template -> {$type}_template
WordPress Trac
noreply at wordpress.org
Thu Jun 29 16:04:47 UTC 2017
#41198: Reference dynamic hooks in doc blocks, e.g. archive_template ->
{$type}_template
--------------------------+---------------------------
Reporter: donutz | Owner: DrewAPicture
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.9
Component: General | Version:
Severity: normal | Resolution: fixed
Keywords: | Focuses: docs
--------------------------+---------------------------
Changes (by DrewAPicture):
* owner: => DrewAPicture
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"40964"]:
{{{
#!CommitTicketReference repository="" revision="40964"
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.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41198#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list