[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
Tue Jul 24 14:18:20 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     |
----------------------------+-----------------------------
Changes (by bradyvercher):

 * cc: brady@… (added)


Comment:

 I came up with a concept for attempting to solve this issue awhile back on
 a smaller scale, but thought it might be useful here. Basically, the
 current behavior would continue to work, but if a developer passed an
 array to `menu_icon` (or even `screen_icon`), then CSS would be generated
 for a sprite. The array would simply contain the url as it's first
 argument, then a set of coordinate adjustments as the second argument, and
 if desired, a third argument would be the coordinate adjustments for a
 hover state. It'd work with a single sprite or individual sprites for each
 image.

 It's similar to some of the concepts mentioned, but might be a little more
 flexible than a rigid template. My code is [in this
 plugin](https://github.com/thelukemcdonald/post-format-menus/blob/master
 /post-format-menus.php) for anyone interested in taking a look and seeing
 if it'd be of any use.

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


More information about the wp-trac mailing list