[wp-trac] [WordPress Trac] #13239: Filter locate_template template_names variable

WordPress Trac noreply at wordpress.org
Mon Mar 10 01:26:39 UTC 2014


#13239: Filter locate_template template_names variable
--------------------------+-----------------------------
 Reporter:  chrisbliss18  |       Owner:
     Type:  enhancement   |      Status:  reopened
 Priority:  normal        |   Milestone:  Future Release
Component:  Themes        |     Version:  3.0
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------

Comment (by MikeSchinkel):

 Replying to [comment:74 rmccue]:
 > IMO, more complex cases like this are best handled by the theme itself.
 There's nothing stopping you adding a `mytheme_get_template_part` that
 handles any sort of use cases you need, backed by `locate_template` in the
 same way that the normal `get_template_part` is.

 But then you have a theme that nobody except the developer of the theme
 and its (small group of) loyal users understand.

 > Introducing more complicated part hierarchy into core removes the
 flexibility of doing it yourself.

 How does adding flexibility to enable `get_template_part()` to support a
 new but defined structure removes flexibility? If a structure for template
 parts were added to core you'd still be able to do exactly what you
 suggested if you don't like the new structure.

 That said, doesn't the flexibility you speak of contradict @nacin's
 assertion that the predicability of the template hierarchy (and thus of a
 potential template parts hierarchy) is a plus?

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


More information about the wp-trac mailing list