[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
Wed Jul 25 02:28:07 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 azaozz):

 Replying to [comment:24 bradyvercher]:
 > ...if a developer passed an array to `menu_icon` (or even
 `screen_icon`), then CSS would be generated for a sprite.

 This would be about the same as outputting the actual css in the head, but
 more limiting. Imho it's easier/cleaner to have:

 {{{
 function my_css() {
   ?>
   <style>
   #my-id {
     background: url("...") no-repeat -20px -40px;
   }
   @media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
     #my-id {
       background-image: url("...-2x");
       background-size: 100px 50px;
     }
   }
   </style>
   <?php
 }
 add_action('admin_head', 'my_css');
 }}}

 Don't think any plugin dev would have problem learning how to write that
 bit of css. Perhaps more helpful will be to have a good codex page
 describing how to write it and make the sprite(s).

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


More information about the wp-trac mailing list