Opened 7 years ago
Closed 7 years ago
#7675 closed defect (bug) (fixed)
Check bp_attachments_get_template_part() & revise it's hardcoded template directory
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Templates | Keywords: | |
Cc: |
Description
This is just to highlight something we perhaps need to examine and relates partly to the recent relocation of the assets dir in themes ( #7672 )
In bp-core/bp-core-attachements.php
we run a function bp_attachements_get_template_part($slug)
L: 923 to locate the part required.
Normally it will return bp_get_template_part( $attachment_template_part ) e.g
assets/_attachments/upload.php`
I assume - as things appear ok with the change - this returns new location ok.
However in the function we test for is_admin() to load parts for admin screens and this is to some extent hardcoded to 'legacy' e.g:
$attachment_admin_template_part = buddypress()->themes_dir . '/bp-legacy/buddypress/' . $attachment_template_part . '.php'
While that will work as we preserved the assets dir in legacy, do we want to locate parts from legacy by default?
I need to review where/how this is being used in the admin, but I'd guess we want to use the appropriate template functions to fetch the right template from the stack, rather than hardcode a path.
Good find!