Sunday, March 26, 2023
Learning Code
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#
No Result
View All Result
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#
No Result
View All Result
Learning Code
No Result
View All Result
Home JavaScript

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

learningcode_x1mckf by learningcode_x1mckf
November 23, 2022
in JavaScript
0
BuddyPress 11.0.0 to Limit JavaScript and CSS Asset Loading to Community Pages Using a Filter – WP Tavern
74
SHARES
1.2k
VIEWS
Share on FacebookShare on Twitter


You might also like

Hackers Inject Weaponized JavaScript (JS) on 51,000 Websites – GBHackers

4 Ways to Remove a Specific Item From a JavaScript Array – MUO – MakeUseOf

Toolkit Allows JavaScript Devs to Program Embedded Devices – The New Stack

BuddyPress will quickly be improving the way it loads its JavaScript and CSS assets in order that they’re solely loaded on neighborhood pages. Beforehand, the plugin would load them indiscriminately on each web page.

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

“It’s not going that will help you a lot and can trigger a number of points in future,” BuddyPress contributor Brajesh Singh mentioned. “There are dependent plugins which can begin throwing JavaScript errors and breaking a few of your web site performance. It’s not well worth the effort.”

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.

Class: BuddyPress, News



Source link

Share30Tweet19
learningcode_x1mckf

learningcode_x1mckf

Recommended For You

Hackers Inject Weaponized JavaScript (JS) on 51,000 Websites – GBHackers

by learningcode_x1mckf
March 25, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Hackers Inject Weaponized JavaScript (JS) on 51,000 Websites  GBHackers Source link

Read more

4 Ways to Remove a Specific Item From a JavaScript Array – MUO – MakeUseOf

by learningcode_x1mckf
March 24, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

4 Ways to Remove a Specific Item From a JavaScript Array  MUO - MakeUseOf Source link

Read more

Toolkit Allows JavaScript Devs to Program Embedded Devices – The New Stack

by learningcode_x1mckf
March 23, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Toolkit Allows JavaScript Devs to Program Embedded Devices  The New Stack Source link

Read more

Select data value from grandparent div? – JavaScript – SitePoint

by learningcode_x1mckf
March 23, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Select data value from grandparent div? - JavaScript  SitePoint Source link

Read more

How to Handle Errors in JavaScript – Programming – MUO – MakeUseOf

by learningcode_x1mckf
March 23, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

How to Handle Errors in JavaScript - Programming  MUO - MakeUseOf Source link

Read more
Next Post
Senior Java Developer at Datonomy Solutions – Gauteng Johannesburg North

Senior Java Developer at Datonomy Solutions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related News

ICJR Urges Criminal Inquiry Against Police in East Java Football Tragedy

ICJR Urges Criminal Inquiry Against Police in East Java Football Tragedy

October 4, 2022
Rethinking Java @Scheduled Tasks in Kubernetes

Rethinking Java @Scheduled Tasks in Kubernetes

January 20, 2023
How to Get a List of All Files in a Directory With Python – Real Python

How to Get a List of All Files in a Directory With Python – Real Python

November 28, 2022

Browse by Category

  • C#
  • C++
  • Java
  • JavaScript
  • Python
  • Swift

RECENT POSTS

  • 2023 Java roadmap for developers – TheServerSide.com
  • YS Jagan launches Ragi Java in Jagananna Gorumudda, says focused on intellectual development of students – The Hans India
  • Disadvantages of Java – TheServerSide.com

CATEGORIES

  • C#
  • C++
  • Java
  • JavaScript
  • Python
  • Swift

© 2022 Copyright Learning Code

No Result
View All Result
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#

© 2022 Copyright Learning Code

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?