BuddyPress 11.0.0 to Limit JavaScript and CSS Asset Loading to Community Pages Using a Filter

BuddyPress 11.0.0 to Limit JavaScript and CSS Asset Loading to Community Pages Using a Filter

Posted by WP Tavern on November 22, 2022 at 4:59 pm
kitty kitty CATegory News
BuddyPress will soon be improving the way it loads its JavaScript and CSS assets so that they are only loaded on community pages. Previously, the plugin would load them indiscriminately on every page. BuddyPress lead developer Mathieu Viet said he’s not sure there is a specific reason explaining why this was kept in place. Before the plugin introduced the BP Theme Compat API in version 1.7, it was necessary to use a BuddyPress compatible theme like the one bundled by default (BP Default). “I think we kept the way this theme was loading these assets into the first Template Pack (BP Legacy) we added to BuddyPress,” Viet said. Users have often requested BuddyPress only load its assets on community pages in hopes of further optimizing their websites. For example, in 2020, a user on the BuddyDev forums requested custom code to accomplish this. Experts recommended against doing it “It is not going to help you much and will cause a lot of issues in future,” BuddyPress contributor Brajesh Singh said. “There are dependent plugins which may start throwing JavaScript errors and breaking some of your site functionality. It is not worth the effort.” Singh recommended the user enable browser caching…

…Full post on WP Tavern
Read Full

Similar Posts

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments