[wp-trac] [WordPress Trac] #14310: Make template hierarchy filterable

WordPress Trac noreply at wordpress.org
Wed Oct 21 19:13:28 UTC 2015


#14310: Make template hierarchy filterable
------------------------------+--------------------------
 Reporter:  scribu            |       Owner:  johnbillion
     Type:  enhancement       |      Status:  reviewing
 Priority:  normal            |   Milestone:  4.4
Component:  Themes            |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:  template
------------------------------+--------------------------
Changes (by johnbillion):

 * keywords:  has-patch dev-feedback => has-patch commit


Comment:

 Recap of discussion in this ticket and elsewhere:

 Advantages of introducing this filter:

  * The `$template` array can be used in a client-side templating app.
  * The `$template` array can be used in a debugging plugin.
  * Allows language-specific versions of template files in multilingual
 plugins.
  * Allows control over cascading and priority of template files.

 Potential disadvantages of introducing this filter:

  * Allows abuse of control over the priority of template files.
  * Alows template files to be removed, thus removing consistency.

 Bear in mind that the `template_include` and `{type}_template` filters
 negate any arguments against such a filter allowing the template hierarchy
 to be abused. It already can be.

 I'm strongly in favour of adding this filter into 4.4.
 [attachment:template_hierarchy.6.diff] refreshes the patch.

 Related tickets which I've been considering holistically along with this:

  * #12877
  * #13239
  * #22355

 Going to give this a final discussion in the dev chat this evening.

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


More information about the wp-trac mailing list