Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#41917 closed defect (bug) (fixed)

Exclude more shortcodes in word counter

Reported by: ocean90 Owned by: pento
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.3
Component: Editor Keywords: has-patch
Focuses: Cc:


Since #27386 shortcodes are ignored in the word counter. But due to the way how shortcodes are passed to JavaScript the counter only ignores shortcodes which are registered before the init hook (or with a lower priority on init).

Attached patch moves the localization into wp_just_in_time_script_localization() to get access to all shortcodes.

Attachments (1)

41917.patch (1.7 KB) - added by ocean90 4 years ago.

Download all attachments as: .zip

Change History (3)

4 years ago

This ticket was mentioned in Slack in #core by melchoyce. View the logs.

4 years ago

#2 @pento
4 years ago

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

In 41844:

Editor: Improve the accuracy of the list of shortcodes that the word count ignores.

Previously, shortcodes were being counted when the init action fired, even though it's possible for shortcodes to be registered later than that.

By leaving the counting until just before the script is printed, we get a more accurate list of shortcodes.

Props ocean90.
Fixes #41917.

Note: See TracTickets for help on using tickets.