#8679 closed task (fixed)
Only load template pack JS & CSS assets when needed
Reported by: | imath | Owned by: | imath |
---|---|---|---|
Milestone: | 12.0.0 | Priority: | high |
Severity: | normal | Version: | |
Component: | Templates | Keywords: | has-patch |
Cc: |
Description
Currently these assets are loaded everywhere. These should only be loaded when true === is_buddypress()
.
Attachments (2)
Change History (13)
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
2 years ago
#3
@
2 years ago
- Keywords 2nd-opinion added; needs-testing removed
To follow up with the discussion we had during July 6 dev-chat, I've updated the patch to introduce a new filter bp_enqueue_assets_in_bp_pages_only
(instead of a constant) we can use to customize how BuddyPress assets are loaded according to 2 options:
- everywhere (return
false
to the filter). - only in
is_buddypress()
areas (returntrue
to the filter).
For 11.0.0 the default value will be false
: we'll carry on loading BP Assets everywhere. This way we take no risks with BP Plugins which might need these assets everywhere while we let people wishing to contribute to BuddyPress use add_filter( 'bp_enqueue_assets_in_bp_pages_only', '__return_true' );
to restrict BP assets to BP areas only. We'll be able to see if these contributors warn us about broken things (I suspect mainly in BP Legacy widgets).
Before releasing 12.0.0, we'll be able to change our default value to true considering BP Plugins authors had time to check their plugins.
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
2 years ago
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
2 years ago
#7
@
22 months ago
- Keywords needs-patch added; has-patch 2nd-opinion removed
- Milestone changed from 11.0.0 to 12.0.0
- Resolution fixed deleted
- Status changed from closed to reopened
- Type changed from defect (bug) to task
It's time to move the other way around!
Let's change our default value to true considering BP Plugins authors had time to check their plugins.
This ticket was mentioned in PR #64 on buddypress/buddypress by @imath.
22 months ago
#8
- Keywords has-patch added; needs-patch removed
Trac ticket: https://buddypress.trac.wordpress.org/ticket/8679
The above patch is introducing the
bp_enqueue_community_scripts
action hook which is only fired whenis_buddypress()
. It seems to be enough.. But I believe it needs more testing especially with legacy widgets...