Skip to:
Content

Opened 3 years ago

Closed 20 months ago

#2930 closed enhancement (fixed)

Don't load editor.js file on non-bbpress pages

Reported by: slaFFik Owned by: johnjamesjacoby
Milestone: 2.6 Priority: normal
Severity: normal Version:
Component: Tools - Code Improvements Keywords: needs-patch commit
Cc:

Description

Although it might be tricky, but I suppose most of sites don't load a bbPress editor on non-forums/topics pages.
So I assume this might be a good small optimization.

/wp-content/plugins/bbpress/templates/default/js/editor.js?ver=2.5.8-5815

Change History (5)

#1 @netweb
3 years ago

  • Keywords reporter-feedback added
  • Milestone changed from Awaiting Review to Under Consideration

Thanks @slaFFik

I'm not seeing that loaded on a standard post page though e.g. http://src.wordpress-develop.dev/2016/04/14/test-post/

I do see the bbpress.css though: wp-content/plugins/bbpress/src/templates/default/css/bbpress.css

Where did you see editor.js loaded when it shouldn't be?

#2 @slaFFik
3 years ago

  • Keywords reporter-feedback removed

Ok, here are my details:

Site: http://cosydale.com
Plugins: BuddyPress 2.5.2 installed.
Groups forums are integrated with bbPress 2.x

editor.js is loaded on home page (didn't check other pages though).

#4 @johnjamesjacoby
20 months ago

  • Component changed from General to Tools - Code Improvements
  • Keywords commit added
  • Milestone changed from Under Consideration to 2.6

is_bbpress() now supports bbp_has_shortcode() so this is now achievable.

#5 @johnjamesjacoby
20 months ago

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

In 6615:

Template Packs: In default theme, only enqueue editor.js when in_bbpress().

This results in 1 fewer external asset being enqueued on non-bbPress pages.

Fixes #2930.

Note: See TracTickets for help on using tickets.