Skip to:

Opened 10 years ago

Closed 10 years ago

#5209 closed defect (bug) (fixed)

enqueue bp_core_confirmation_js

Reported by: bassjobsen's profile bassjobsen Owned by: boonebgorges's profile boonebgorges
Milestone: 2.0 Priority: normal
Severity: normal Version: 1.8.1
Component: Core Keywords:


./buddypress/bp-core/bp-core-cssjs.php sets add_action( 'wp_head', bp_core_confirmation_js', 100 ); where bp_core_confirmation_js add javascript to the head which depends on jquery. This code should be enqueued with wp_enqueue_script() to set the jquery dependency. Localization can be add with: wp_localize_script().

Thanks for your attention. I will need this fixes to get WP Defer Loading work with BuddyPress, see:

Change History (4)

#1 @boonebgorges
10 years ago

I'm not totally sure why we do it this way (rather than proper enqueuing). I guess the idea is that there are places where we would want the .confirm JS but we don't want to load our entire script library. That makes sense, but in that case why not just have a separate .js file for confirm links? It'll get cached pretty heavily, so I can't imagine a huge performance issue.

Would like an opinion from another dev before moving forward with it.

#2 @bassjobsen
10 years ago

Thanks. Localization has been the reason maybe. wp_localize_script() will solve this

#3 @boonebgorges
10 years ago

  • Milestone changed from Awaiting Review to 2.0

#4 @boonebgorges
10 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 8091:

Move .confirm javascript to a separate, properly enqueued file

This improves our compliance with WP standards, improves our integration with
caching systems, and allows plugins to manage the conditional loading of

Fixes #5209

Note: See TracTickets for help on using tickets.