BuddyPress lead developer Mathieu Viet mentioned he’s unsure there’s a particular cause explaining why this was stored in place. Earlier than the plugin introduced the BP Theme Compat API in model 1.7, it was essential to make use of a BuddyPress suitable theme just like the one bundled by default (BP Default).
“I feel we stored the best way this theme was loading these belongings into the primary Template Pack (BP Legacy) we added to BuddyPress,” Viet mentioned.
Customers have usually requested BuddyPress solely load its belongings on neighborhood pages in hopes of additional optimizing their web sites. For instance, in 2020, a consumer on the BuddyDev boards requested custom code to perform this. Consultants really helpful towards doing it
Singh really helpful the consumer allow browser caching to keep away from loading the belongings a number of occasions and persist with finest practices for enabling gzip compression and different optimization measure. He additionally really helpful including a plugin that might conditionally forestall loading BuddyPress on sure pages.
Coming in model 11.0.0, BuddyPress core will progressively transfer in the direction of loading solely the belongings it wants in neighborhood areas. This replace will nonetheless load JS and CSS in every single place however will supply a filter that customers can add to their bp-custom.php recordsdata with the intention to maintain BP belongings on neighborhood pages solely:
add_filter( ‘bp_enqueue_assets_in_bp_pages_only’, ‘__return_true’ );
“If utilizing the above filter, you discover one thing goes incorrect together with your web site on account of the usage of a particular BP plugin or theme, report it here and we’ll then have one other improvement cycle to make things better earlier than we utterly limit these belongings to BuddyPress generated pages in a second step in model 12.0.0,” Viet mentioned.
Model 11.0.0 is predicted to be launched on December 14, 2022. Early adopters and BuddyPress web site homeowners who’ve at all times wished for the plugin to behave this fashion can benefit from it after the subsequent main replace utilizing the filter. The filter will also be simply eliminated if customers are troubleshooting and having points with plugins.
Leave a Reply