BuddyPress lead developer Mathieu Viet mentioned he’s undecided there’s a particular motive explaining why this was saved in place. Earlier than the plugin introduced the BP Theme Compat API in model 1.7, it was obligatory to make use of a BuddyPress suitable theme just like the one bundled by default (BP Default).
“I feel we saved the best way this theme was loading these belongings into the primary Template Pack (BP Legacy) we added to BuddyPress,” Viet mentioned.
Customers have typically requested BuddyPress solely load its belongings on neighborhood pages in hopes of additional optimizing their web sites. For instance, in 2020, a person on the BuddyDev boards requested custom code to perform this. Consultants really useful towards doing it
Singh really useful the person allow browser caching to keep away from loading the belongings a number of occasions and keep on with greatest practices for enabling gzip compression and different optimization measure. He additionally really useful including a plugin that will conditionally stop 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 hold 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 improper together with your web site as a result of using a selected BP plugin or theme, report it here and we’ll then have one other growth 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 reap the benefits of it after the following main replace utilizing the filter. The filter may also be simply eliminated if customers are troubleshooting and having points with plugins.