[wp-trac] [WordPress Trac] #14310: Make template hierarchy filterable
WordPress Trac
noreply at wordpress.org
Fri Oct 30 23:56:52 UTC 2015
#14310: Make template hierarchy filterable
------------------------------+-----------------------------
Reporter: scribu | Owner: johnbillion
Type: enhancement | Status: reviewing
Priority: normal | Milestone: Future Release
Component: Themes | Version:
Severity: normal | Resolution:
Keywords: has-patch commit | Focuses: template
------------------------------+-----------------------------
Comment (by influencebydesign):
Thanks for your response. I can see how some filters being used by plugins
without the end user’s knowledge could cause issues. At the same time, one
of the things that makes WordPress so great is how you can customize it to
your needs and change default behaviour to achieve desired outcomes.
The way I see it, I could already completely change the way the template
hierarchy works through the template_include filter. If I really wanted
to, I could duplicate the logic to determine the array of templates based
on the current template hierarchy. However, this is very inefficient since
it has already been determined and would require maintenance to keep it in
step with future changes. Thus, the real issue becomes not whether the
template hierarchy should be changeable, but whether people should have
access to what the default template hierarchy should be. Currently you
allow people to change it, but they can not do so in an informed manner
which I see as even more of an issue.
Replying to [comment:65 DrewAPicture]:
> Replying to [comment:64 influencebydesign]:
> > So why does this ticket seem to have such a problem getting through
the process? The last time the Milestone was changed to Future Release was
5 years ago. I'm not familiar with the ins and outs of WordPress's core,
but it seems like the idea behind apply_filters is that by default without
hooked functions it wouldn't change anything.
>
> The problem is that while on the surface this seems like a simple
change, it could have far-reaching unintended consequences. Making the
template hierarchy broadly filterable would effectively make it possible
to completely override expected behavior for how templates work in
WordPress. That's a really big deal.
>
> When used ''as intended'' it's not a bad idea. But time and again, core
has introduced hooks that have been ''misused'' and abused, and if enough
people are doing the abusing, that sometimes becomes something core has to
support.
>
> Part of what makes WordPress so approachable by developers of all levels
is that there are certain constants in how it can be expected to work.
Therefore, I don't think it's unreasonable to approach a feature request
like this with a high level of caution as has been demonstrated here.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/14310#comment:66>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list