Make WordPress Core

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#31766 closed defect (bug) (fixed)

'word-count' always enqueued, even when not needed

Reported by: johnjamesjacoby Owned by: iseulde
Priority: normal Milestone: 4.3
Component: Editor Version:
Severity: normal Keywords: has-patch 2nd-opinion
Cc: Focuses:

Description

When tinymce is false (and subsequently when teeny is true) the word-count script is still enqueued, even though there is no relevant UI for it to report back to.

This results in WordPress enqueueing /wp-admin/js/word-count$suffix.js when it does not appear to be necessary, and also inserts an additional script tag for the accompanying wordCountL10n localized value.

Attachments (1)

31766.01.patch​ (476 bytes ) - added by johnjamesjacoby 12 years ago.
Move the word-count enqueue into the self::$has_tinymce check

Download all attachments as: .zip

Change History (8)

@johnjamesjacoby
12 years ago

Move the word-count enqueue into the self::$has_tinymce check

#1 @johnjamesjacoby
12 years ago

  • Keywords has-patch 2nd-opinion added

#2 @johnjamesjacoby
12 years ago

For a quick way to confirm this:

Notice the script tag and included javascript file, even though no visual editor or word count UI exists

#3 @DrewAPicture
12 years ago

First of all, seems like a valid expectation that we wouldn't want to enqueue 'word-count' if there's no editor. So with that in mind, what about using dependencies to load it instead of individually enqueuing them?

#4 @iseulde
11 years ago

  • Component TinyMCE → Editor
  • Focuses performance removed

#5 @iseulde
11 years ago

In [32856] this has become a dependency of post.js, so it should be removed.

#6 @iseulde
11 years ago

  • Owner set to iseulde
  • Resolution → fixed
  • Status new → closed

In 33295:

Editor: word count: remove redundant script enqueuing

It is now a dependency of post.

Part props johnjamesjacoby.
Fixes #31766. See #30966.

#7 @iseulde
11 years ago

  • Milestone Awaiting Review → 4.3
Note: See TracTickets for help on using tickets.