[wp-trac] [WordPress Trac] #41564: Search for hyphenated post templates for post types with underscores

WordPress Trac noreply at wordpress.org
Sun Aug 6 19:39:13 UTC 2017


#41564: Search for hyphenated post templates for post types with underscores
-------------------------------+------------------------------
 Reporter:  desrosj            |       Owner:
     Type:  feature request    |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  dev-feedback       |     Focuses:  template
-------------------------------+------------------------------

Comment (by jmichaelward):

 @desrosj Here's a first-look patch that attempts to address this issue, by
 way of prepending a hyphenated archive template name within the logic of
 get_archive_template in template.php. When applied, this patch will allow
 a file to be named `archive-custom_post_type.php` or `archive-custom-post-
 type.php`, where the latter will take higher precedence in the template
 hierarchy.

 To fully address the issue, I suspect that other templates - such as
 single - would need to be updated, as well. The larger question is whether
 this would be considered "code churn", but I do think that making updates
 to allow devs to name their templates in adherence to the WordPress Coding
 Standards is advisable and should be encouraged.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41564#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list