[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 21:20:02 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:37 kovshenin]:
> ... However the misleading part remains, the `menu_icon` argument, which
I'd really like to use but ended up not doing so, both for the admin menu
and screen icons, because it generates images, not divs I'd want to use.
Passing the string `'div'` instead of an url as `$icon_url` in
`add_menu_page()` would output the same padded div as used in the default
top menu items where a background can be set with css.
If there must be an automated way of doing this, I agree with @scribu and
@helenyhou: that should require a sprite with specific dimensions. We can
have a "template image" for it in the codex, etc.
Then passing an array to `'menu_icon'` in `register_post_type()` should
leave out `menu-icon-post` class from the <li> and the `icon-edit` id from
the screen icon. The array can support passing the actual css which will
simplify all this or the URLs to the sprites (assuming there is 2x
sprite). Passing an empty array would leave the menu icon and screen icon
without backgrounds so it's easier to use custom css there.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20052#comment:40>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list