[wp-trac] [WordPress Trac] #20052: Support sprites for admin menu icons in register_post_type and add_menu_page

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 27 16:03:18 UTC 2012


#20052: Support sprites for admin menu icons in register_post_type and
add_menu_page
----------------------------+-----------------------------
 Reporter:  helenyhou       |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Future Release
Component:  Administration  |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+-----------------------------

Comment (by azaozz):

 Replying to [comment:26 bradyvercher]:
 > ... this appears to be the amount of CSS required to get menu icons and
 screen icons with a standard state, hover/active states, and retina
 support when you call `register_post_type()` and `add_menu_page()`, in
 essence, matching the current default styles and behavior...

 This CSS block appears to be using different images and sprites and some
 of the styles are repeating. If this had to be set by an API, you wouldn't
 be able to do that and would need to make new sprite.

 > So I don't see any harm in creating a simple, consistent API that does
 most everything any developer is going to need...

 There are 7-8 different ways this can be done in CSS, if that API would
 need to cover all it would be neither simple nor clear.

 The biggest problem with APIs that automatically output code in another
 language (i.e. PHP API for CSS code) is that the plugin developers would
 have to learn how the CSS works (so they know what values to pass in), and
 then how the API works. So instead of making something simpler, it makes
 it more complicated and demands more from the developers. On top of that
 there are always limitations when any type of code is auto-generated.

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


More information about the wp-trac mailing list