[wp-trac] [WordPress Trac] #23151: get_attachment_template() doesn't follow the pattern of its get_{type}_template() siblings

WordPress Trac noreply at wordpress.org
Tue Jan 8 22:14:14 UTC 2013


#23151: get_attachment_template() doesn't follow the pattern of its
get_{type}_template() siblings
-----------------------------+--------------------------
 Reporter:  rulatir          |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Template
  Version:  3.5              |   Severity:  minor
 Keywords:                   |
-----------------------------+--------------------------
 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).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23151>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list