Opened 14 years ago
Closed 14 years ago
#23151 closed enhancement (duplicate)
get_attachment_template() doesn't follow the pattern of its get_{type}_template() siblings
| Reported by: | rulatir | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Template | Version: | 2.0 |
| Severity: | minor | Keywords: | has-patch |
| Cc: | Focuses: |
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
@
14 years ago
- Keywords has-patch added
- Milestone Awaiting Review → 3.6
- Type defect (bug) → enhancement
#3
in reply to: ↑ 2
@
14 years ago
[nevermind; in this comment I made an observation that I later found to be incorrect]
#4
in reply to: ↑ 2
@
14 years ago
Replying to SergeyBiryukov:
Btw. that was the fastest anyone has ever implemented my enhancement request :)
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Introduced as
get_subpost_template()in [2958], renamed toget_attachment_template()in [3092].