Opened 12 years ago
Closed 12 years ago
#23151 closed enhancement (duplicate)
get_attachment_template() doesn't follow the pattern of its get_{type}_template() siblings
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 2.0 |
Component: | Template | Keywords: | has-patch |
Focuses: | Cc: |
Description
The get_attachment_template() function in template.php is implemented differently from most other get_{type}_template() functions.
Other functions build a list of candidates and pass it to get_query_template(), but get_attachment_template() checks the candidates by itself as it goes, and only calls get_query_template('archive') for the basic case.
I cannot see a reason for this, so I am tentatively filing this as a code quality issue.
(N.b. I am refactoring these functions as part of implementing #23142. In most of them the generation of the candidates list can be trivially factored out with demonstrable correctness, but get_attachment_template() is a harder case due to this inconsistency).
Attachments (1)
Change History (6)
#2
follow-ups:
↓ 3
↓ 4
@
12 years ago
- Keywords has-patch added
- Milestone changed from Awaiting Review to 3.6
- Type changed from defect (bug) to enhancement
#3
in reply to:
↑ 2
@
12 years ago
[nevermind; in this comment I made an observation that I later found to be incorrect]
#4
in reply to:
↑ 2
@
12 years ago
Replying to SergeyBiryukov:
Btw. that was the fastest anyone has ever implemented my enhancement request :)
Introduced as
get_subpost_template()
in [2958], renamed toget_attachment_template()
in [3092].