[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:53:43 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 sorich87):

 Yes you can load other files with the action but will you be able to do
 anything to prevent locating the original file?

 Yes, I can hook into it with a custom function which will load the file
 from my custom location using a modified version of locate_template, then
 die() so that locate_template is never used.

   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.

 get_template_part also allows loading files from sub folders.
 The equivalent of 'locate_template( 'dir/file.php' ) is get_template_part(
 'dir/file' ). So uniformity will be maintained.

-- 
Ticket URL: <http://trac.buddypress.org/ticket/2956#comment:5>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list