Changes between Initial Version and Version 3 of Ticket #4755
- Timestamp:
- 01/16/2013 07:50:02 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #4755
- Property Cc rogercoathup added
-
Property
Summary
changed from
Template stack: Address usage of bp_locate_template()
toAddress usage of bp_locate_template()
-
Ticket #4755 – Description
initial v3 1 If you use `bp_locate_template()` by itself, it will not see the custom directory locations (like 'buddypress' and 'community' as set in `bp_get_template_locations()`) because only `bp_get_template_part()` has a filter that is hooked in by `bp_add_template_locations()`.1 Let's try this again. 2 2 3 This is a problem in the current codebase as `bp_has_custom_signup_page()` and `bp_has_custom_activation_page()` both use `bp_locate_template()`. 3 '''One-line summary:''' 4 `bp_locate_template()` does not mirror the same set of templates as `bp_get_template_part()`. 4 5 5 This leads to issues with the "Register" links in both single and multisite as BP does not hijack them as in previous BP releases. 6 '''Side-effects:''' 7 Currently, `bp_locate_template()` does not check a theme's custom subdirectories ('buddypress', 'community' ) for templates. 6 8 7 ---- 9 This is a problem when theme compat is on as bp-legacy's templates are located in the 'buddypress' subdirectory. 8 10 9 I listed a potential solution in the second patch of #4656. 11 The main issue is `bp_locate_template()` is used in these two functions: 10 12 11 If that approach is not acceptable, then I believe we'll need a method that makes sure both `bp_get_template_part()` and `bp_locate_template()` references the same templates at all times. 13 * bp_has_custom_signup_page() 14 * bp_has_custom_activation_page() 12 15 13 Let me know if I'm not being clear. 16 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. 17 18 '''Why do bp_locate_template() and bp_get_template_part() reference different templates?''' 19 It's due to this: 20 21 {{{ 22 add_filter( 'bp_locate_template', 'bp_add_template_locations' ); 23 add_filter( 'bp_get_template_part', 'bp_add_template_locations' ); 24 }}} 25 26 The 'bp_locate_template' filter does not exist and was removed in r6537. 27 28 This leads to the registration / activation templates are not detected properly when theme compat is on. 29 30 '''Conclusion''' 31 We need a solution so both bp_locate_template() and bp_get_template_part() references the same templates at all times. 32 33 Some potential methods include: 34 35 1. Adding back the `'bp_locate_template'` filter that was removed in r6537. 36 2. Adding the custom subdirectory locations at the template stack level. Attached patch is an attempt at this.