Opened 2 years ago
Last modified 16 months ago
#8842 new defect (bug)
Filter to stop assets loading outside of BuddyPress Core is not working
Reported by: | DeFries | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Contributions | Priority: | normal |
Severity: | normal | Version: | 11.1.0 |
Component: | Core | Keywords: | needs-patch |
Cc: |
Description
Inside a WordPress multi-site environment, I have BuddPress network activated. I've added the following to the top of my bp-custom.php file:
/** * Stop loading BuddyPress assets in places where that's not needed. */ add_filter( 'bp_enqueue_assets_in_bp_pages_only', '__return_true' );
However, the assets are still loaded everywhere. There's no change in what's loaded. Full context: the root of the site is a subdomain of the multi-site, and I'm checking a domain-mapped subsite's frontpage. I've added a screenshot of what I'm still seeing be loaded.
Attachments (1)
Change History (7)
#1
@
2 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 12.0.0
Hi @DeFries
Thanks a lot for your feedback π. Itβs actually another issue, the filter is avoiding loading the template pack assets (the big buddypress.js & css).
I agree we should also load BP Block assets when they are used only. Weβll try to work on this moving to Block API v2 during 12.0.0 dev cycle.
#2
@
2 years ago
Ah, okay. My assumption was indeed that these stylesheets would also not be loaded where they didn't make any sense to be loaded.
Looking forward to 12.0.0 then βΊοΈ.
This ticket was mentioned in βSlack in #buddypress by imath. βView the logs.
17 months ago
#6
@
16 months ago
- Milestone changed from 12.0.0 to Awaiting Contributions
These BP Block styles are only loaded when used in Block themes, but regular themes are still loading them everywhere. I can't remember if WordPress is providing a way to avoid this in regular themes. If someone can give me the documentation/make link I'll be happy to come back on this ticket. In the meantime, moving this ticket in awaiting-contributions.
Screenprint of the site's source code.