[buddypress-trac] [BuddyPress] #4755: Address usage of bp_locate_template()

buddypress-trac noreply at wordpress.org
Wed Jan 16 19:51:55 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  |
------------------------------------+------------------
Changes (by r-a-y):

 * keywords:  dev-feedback => dev-feedback has-patch


Old description:

> Let's try this again.
>
> '''One-line summary:'''
> `bp_locate_template()` does not mirror the same set of templates as
> `bp_get_template_part()`.
>
> '''Side-effects:'''
> Currently, `bp_locate_template()` does not check a theme's custom
> subdirectories ('buddypress', 'community' ) for templates.
>
> This is a problem when theme compat is on as bp-legacy's templates are
> located in the 'buddypress' subdirectory.
>
> The main issue is `bp_locate_template()` is used in these two functions:
>
> * bp_has_custom_signup_page()
> * bp_has_custom_activation_page()
>
> Since bp_locate_template() is used in these functions, when theme compat
> is on, this leads to the registration / activation templates not being
> properly detected and hence the registration hijack that BP usually does
> fails.
>
> '''Why do bp_locate_template() and bp_get_template_part() reference
> different templates?'''
> It's due to this:
>
> {{{
> add_filter( 'bp_locate_template',   'bp_add_template_locations' );
> add_filter( 'bp_get_template_part', 'bp_add_template_locations' );
> }}}
>
> The 'bp_locate_template' filter does not exist and was removed in r6537.
>
> This leads to the registration / activation templates are not detected
> properly when theme compat is on.
>
> '''Conclusion'''
> We need a solution so both bp_locate_template() and
> bp_get_template_part() references the same templates at all times.
>
> Some potential methods include:
>
> 1. Adding back the `'bp_locate_template'` filter that was removed in
> r6537.
> 2. Adding the custom subdirectory locations at the template stack level.
> Attached patch is an attempt at this.

New description:

 Let's try this again.

 '''One-line summary:'''
 `bp_locate_template()` does not mirror the same set of templates as
 `bp_get_template_part()`.

 '''Side-effects:'''
 Currently, `bp_locate_template()` does not check a theme's custom
 subdirectories ('buddypress', 'community' ) for templates.

 This is a problem when theme compat is on as bp-legacy's templates are
 located in the 'buddypress' subdirectory.

 The main issue is `bp_locate_template()` is used in these two functions:

 * bp_has_custom_signup_page()
 * bp_has_custom_activation_page()

 Since bp_locate_template() is used in these functions, when theme compat
 is on, this leads to the registration / activation templates not being
 properly detected and hence the registration hijack that BP usually does
 fails.

 '''Why do bp_locate_template() and bp_get_template_part() reference
 different templates?'''
 It's due to this:

 {{{
 add_filter( 'bp_locate_template',   'bp_add_template_locations' );
 add_filter( 'bp_get_template_part', 'bp_add_template_locations' );
 }}}

 The 'bp_locate_template' filter does not exist and was removed in r6537.

 This leads to the registration / activation templates not being detected
 properly when theme compat is on.

 '''Conclusion'''
 We need a solution so both bp_locate_template() and bp_get_template_part()
 references the same templates at all times.

 Some potential methods include:

 1. Adding back the `'bp_locate_template'` filter that was removed in
 r6537.
 2. Adding the custom subdirectory locations at the template stack level.
 Attached patch is an attempt at this.

--

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4755#comment:4>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list