#18456 closed defect (bug) (fixed)

calling add_editor_style() twice results in the css being added multiple times

Reported by: dd32 Owned by: dd32
Priority: normal Milestone: 3.3
Component: Editor Version: 3.2
Severity: normal Keywords: has-patch
Cc:

Description

In the event a Theme, and a Child theme, both call add_editor_style() the TinyMCE css list will double up:

content_css:"
http://localhost/branch/3.2/wp-content/themes/twentyeleven/editor-style.css,
http://localhost/branch/3.2/wp-content/themes/twentyeleven-child/editor-style.css,
http://localhost/branch/3.2/wp-content/themes/twentyeleven/editor-style.css,
http://localhost/branch/3.2/wp-content/themes/twentyeleven-child/editor-style.css"

(New lines added for readability)

Affects both trunk and 3.2, This does point out it's a "doing it wrong" to call the add_editor_style() in the child theme, but we should also array_unique() the $editor_styles array before searching for the files to enqueue IMO.

Attachments (1)

18456.patch (543 bytes) - added by SergeyBiryukov 22 months ago.

Download all attachments as: .zip

Change History (4)

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 3.3
  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In [18571]:

Only include extra TinyMCE stylesheets once. props SergeyBiryukov. Fixes #18456

Note: See TracTickets for help on using tickets.