[buddypress-trac] [BuddyPress] #2956: Use get_template_part instead of locate_template in BP Default
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Sat Dec 18 11:35:29 UTC 2010
#2956: Use get_template_part instead of locate_template in BP Default
--------------------------+-----------------------------
Reporter: sorich87 | Owner: sorich87
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Theme | Version: 1.3
Resolution: | Keywords:
--------------------------+-----------------------------
Comment (by sbrajesh):
Replying to [comment:3 sorich87]:
> get_template_part too, does not allow filtering and does nothing other
than using locate_template.
>
> This is not true. There is an action in get template part
'get_template_part_{$slug}' which allows filtering.
I absolutely agree that there is an action hook but the action and filter
hooks are different. Yes you can load other files with the action but will
you be able to do anything to prevent locating the original file? other
than not supplying the file to be located in the theme and that subdues
the purpose. I checked the discussion and that is about locate_template. I
too look forward to implementation of one of the patch(It seems to be in
wp 3.2 hopefully) but in current scenario , the change is not going to
have any effect imho.
>
> Further, It is not flexible enough to allow you load the files from
sub directory ?
>
> No, it is not flexible at all. What if don't want to load files from sub
directories but from locations other than the theme directory?
> locate_template can't do that. See the following ticket on the WordPress
trac #WP13239.
In that case, we will have a bunch of mixed code for locate_template as
well as get_template_part as the current bp theme structure requires you
to load files from sub folders. And hopefully, the developers will like to
maintain uniformity and won't be ready to change much in the structure of
current theme structure for bp-default.
--
Ticket URL: <http://trac.buddypress.org/ticket/2956#comment:4>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list