[wp-trac] [WordPress Trac] #19510: wp_editor() causing wp_print_styles to bleed into admin

WordPress Trac wp-trac at lists.automattic.com
Mon Dec 12 05:03:30 UTC 2011


#19510: wp_editor() causing wp_print_styles to bleed into admin
---------------------------+------------------------------
 Reporter:  AdamBackstrom  |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Editor         |     Version:  3.3
 Severity:  normal         |  Resolution:
 Keywords:                 |
---------------------------+------------------------------

Comment (by dd32):

 You're almost correct, in that wp_print_styles was '''usually only'''
 called on the front end in 3.2, it could be called from within the admin,
 Since ~WordPress 2.6 the function has been called in the admin if a CSS
 stylesheet is enqueued after the other stylesheets have already been
 printed, in 3.3 though, this happens when WP_Editor() is used anywhere
 too.

 `'wp_enqueue_scripts'` is a better hook for adding/enqueueing
 Styles/Javascript on the front end, whilst `'admin_enqueue_scripts'` is
 available on the back-end.

 As you've noted though, It's quite common to suggest using
 `'wp_print_styles'` to enqueue CSS, this might be due to there being no
 `'wp_enqueue_style'` action.. The codex examples all use this too.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19510#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list