[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 11:25:35 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:  needs-patch     |
----------------------------+-----------------------------

Comment (by kovshenin):

 Replying to [comment:29 scribu]:

 Yeah maybe there's some other secret formula that would fit most cases,
 but we can talk about that later. I like your approach of having two
 arrays, but I also think that if 2x is not needed, maybe we can let
 developers not type "regular" and work as a single array too:

 {{{
 'menu_icon' => array(
         'image_url'                 => $image_url,
         'background_position'       => '100, 200',
         'background_position_hover' => '300, 400',
 ),
 }}}

 Also just thinking out loud here about how would most sprites be composed.
 Since the menu icon is 16x16 and the screen icon is 32x32, it makes sense
 to stick both sizes in one sprite, which will give menu + screen icon
 **and** hidpi menu icons assuming the screen icon is just a 2x copy of the
 menu icon and not a totally different grapihc. This means, that at the
 cost of another 64x64 pixels (+ the padding) in that very same sprite,
 they can serve both regular and 2x off of one file, as opposed to creating
 two different files for regular and 2x.

 I'll make an initial patch so we can keep discussing this based on
 something.

 Thanks for your input!

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


More information about the wp-trac mailing list