[wp-trac] Re: [WordPress Trac] #7033: Media uploades css fixes

WordPress Trac wp-trac at lists.automattic.com
Sun May 25 21:09:53 GMT 2008


#7033: Media uploades css fixes
----------------------------+-----------------------------------------------
 Reporter:  azaozz          |        Owner:  anonymous
     Type:  enhancement     |       Status:  closed   
 Priority:  normal          |    Milestone:  2.6      
Component:  Administration  |      Version:           
 Severity:  normal          |   Resolution:  fixed    
 Keywords:  has-patch       |  
----------------------------+-----------------------------------------------
Comment (by mdawaffe):

 I'd lean toward wp_enqueue_style() since it's marginally faster;
 wp_admin_css() is a wrapper.  But I don't really care either.

 wp_admin_css() does more things, though, in order to stay backward
 compatible:
  1. Will act exactly like wp_enqueue_style() if the wp_print_styles action
 has not yet been called.
  1. Will directly echo out the stylesheet link if the wp_print_styles
 action has been called.
  1. If the script is not registered, wp_admin_css() will behave like it
 used to: create a url under the assumption the argument passed was a
 filename (minus the .css extension) and echo out a stylesheet link to that
 file.

 The most efficient thing to do would be to use {{{wp_enqueue_style()}}}
 when we want to enqueue and {{{wp_print_styles()}}} when we want to print
 directly (e.g. wp_print_styles action has already happened at least once,
 admin_print_styles action is never called on that page, etc.).

 wp_admin_css tries to make that decision for us.  I'm not sure if using
 one function to do those two things is more or less confusing.

 Inline docs for wp_admin_css attached.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7033#comment:5>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list