#26742 closed defect (bug) (fixed)
Improve inline docs for get_*_template() functions
Reported by: | UmeshSingla | Owned by: | DrewAPicture |
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.8 |
Component: | Themes | Keywords: | has-patch commit |
Focuses: | docs, template | Cc: |
Description
Description for get_taxonomy_template() function in template.php states that it uses 'template_taxonomy' filter which is seen nowhere in the function
@since 2.5.0
- @uses apply_filters() Calls 'taxonomy_template' filter on found path.
Attachments (6)
Change History (18)
@
11 years ago
Updated description for get_query_template(), as the filter is being applied here in actual
#1
@
11 years ago
get_taxonomy_template(), get_tag_template(), get_category_template() all uses get_query_template(), which calls apply_filters() as per the required type template.
While the description for the function get_taxonomy_template() says it uses apply_filters(), which is slightly confusing. An update in description would help understand the actual flow of function calls.
#2
@
11 years ago
- Component changed from General to Inline Docs
- Keywords has-patch added
- Milestone changed from Awaiting Review to 3.9
The filter is already documented in get_query_template()
: tags/3.8/src/wp-includes/template.php#L30.
I think we can remove @uses apply_filters()
and keep the rest as a regular comment. This should be done consistently for all the functions that use get_query_template()
: 26742.2.patch.
#3
@
11 years ago
I think doing this is a good idea, as dynamic hooks can be tough to track down. I also think this is an excellent use case for an @uses get_query_template()
entry in each phpdoc to serve as a pointer, since all of these are wrappers after all.
As for the added descriptions, I'm not a big fan of the sentence structure of:
"Calls * filter on file path of template.".
Semantically, we don't "call filters", we evaluate them, so for the description, perhaps something like this might work better:
"The template path is filterable via the * hook."
#4
@
11 years ago
I agree to @DrewAPicture , @uses get_query_template()
would me more appropriate and adding a proper description for how actually filter is being called would be helpful, as I myself is a victim of this dynamic hook
I've updated some of the function description on codex for same.
#5
@
11 years ago
- Keywords commit added
@see
tags (per inline docs standards, we avoid@uses
) forget_query_template()
or similar- Adds full return descriptions for all of the wrappers
- Replaces the filter descriptions with the style outlined in comment:3
#7
@
11 years ago
- Summary changed from Misleading function description for get_taxonomy_template() in template.php to Improve inline docs for get_*_template() functions
#8
@
11 years ago
- Owner set to DrewAPicture
- Resolution set to fixed
- Status changed from new to closed
In 26906:
removed unwanted description lines for get_taxonomy_template() function