[buddypress-trac] [BuddyPress] #4755: Address usage of bp_locate_template()
buddypress-trac
noreply at wordpress.org
Thu Jan 17 14:24:16 UTC 2013
#4755: Address usage of bp_locate_template()
------------------------------------+------------------
Reporter: r-a-y | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 1.7
Component: Core | Version: 1.7
Severity: normal | Resolution:
Keywords: dev-feedback has-patch |
------------------------------------+------------------
Comment (by boonebgorges):
template_stack.01.patch seems like it just duplicates the work done by
`bp_add_template_locations()`. If we can fix this problem (which clearly
*is* a problem, as you've described it above - thanks for the
clarification) without repeating ourselves, we should do so. So your
strategy 1 seems better.
Will there be negative consequences to adding the `bp_locate_template`
filter? Looking at the code, I'm guessing that there are two big reasons
for removing the filter in r6537:
a) WP's core template loading functions don't have corresponding filters
in their template loading functions (side note - it's this missing feature
in WP that makes half of the theme compat code necessary. Grr)
b) It's assumed that `bp_locate_template()` will generally only be called
within the context of `bp_get_template_part()`, and there's already a
perfectly good filter in the latter function, so the latter filter seems
redundant.
IMO, (a) is a bad reason for us to omit a filter.
As for (b), if we're really concerned about redundancy, then we should
remove the filter in `bp_get_template_part()` and reinstate the filter in
`bp_locate_template()`. Then we'd only have to run
`bp_add_template_locations()` in one place, at the very end of the
process.
My vote is to re-add the `bp_locate_template` filter and call it good
enough, unless there's something I'm missing.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4755#comment:5>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list