[wp-trac] [WordPress Trac] #30288: set import directory for get_template_part()
WordPress Trac
noreply at wordpress.org
Sat Nov 8 20:58:54 UTC 2014
#30288: set import directory for get_template_part()
-----------------------------+------------------------------
Reporter: Billy Mathews | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses: template
-----------------------------+------------------------------
Comment (by valendesigns):
You want to be able to alter the path so it looks for files outside of the
themes root directory?
The issue wouldn't be solely with `get_template_part()` then, it would be
with `locate_template()` too, as that is the function that does the file
locating using either `STYLESHEETPATH` or `TEMPLATEPATH`.
An option to fix this issue would be to add a boolean`$force_path`
variable to both function that allows for alternative paths outside of the
root of a theme when set to true. Basically, it uses the explicit path
supplied from the `get_template_part()` to find the file and bypass the
global theme paths.
Why do you need to get files outside of the theme? This sounds like plugin
territory to me.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30288#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list