[wp-trac] [WordPress Trac] #41362: Make locate_template() filterable to change the template locations
WordPress Trac
noreply at wordpress.org
Wed Jul 19 15:36:05 UTC 2017
#41362: Make locate_template() filterable to change the template locations
----------------------------+------------------------------
Reporter: kylejennings83 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: 4.8
Severity: normal | Resolution:
Keywords: | Focuses: template
----------------------------+------------------------------
Comment (by dingo_bastard):
For putting CPT's into theme, that's not really a good idea imo. Imagine
that you are developing a product for a client. You create a theme, and
all the custom stuff is in the theme you created. Some time passes and the
client now has a new contractor, who decides to change the theme
completely. Imagine the horror of extracting all that content you bundled
in with the theme.
My rule of thumb is - if you need to create a CPT, put it in a plugin. You
can add custom templates from within the plugin with really not much
hassle: [http://www.wpexplorer.com/wordpress-page-templates-plugin/ adding
page templates inside a plugin].
WordPress isn't meant to be a MVC application, so I really see no reason
for forcing that on it.
But by all means, if you think that is something that would be useful,
submit a patch. I guess it doesn't hurt to have an extra filter around :D
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41362#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list