[wp-trac] [WordPress Trac] #18456: calling add_editor_style() twice results in the css being added multiple times

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 17 05:41:25 UTC 2011


#18456: calling add_editor_style() twice results in the css being added multiple
times
--------------------------+-----------------------------
 Reporter:  dd32          |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  3.2
 Severity:  normal        |   Keywords:  needs-patch
--------------------------+-----------------------------
 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18456>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list