[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 Feb 17 20:21:55 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 helenyhou):
Replying to [comment:18 azaozz]:
> Replying to [comment:17 scribu]:
> > We trade flexibility for convenience; that's what most APIs do...
>
> Right. The problem in this case (as @helenyhou mentions in the ticket
description) is that such sprite would have to match exactly the expected
dimensions and the images (icons) inside it would have to match the
expected positions.
Without the intention of slighting anyone, I would wager that quite a few
developers have zero or nearly no concept of CSS sprites, much less
creating and colorizing them. In parallel with a generation tool, I think
this would actually make it more accessible to those who are not so well-
versed in CSS and image manipulation but work with CPTs and other admin
pages. This shouldn't be about forcing sprites on anybody, just making it
easier to utilize them.
Supporting columns (multiple menu icon sprites in one sheet) similarly
would not lock anybody into using a single sheet for all icons, just make
it easier. Yes, to use the API rather than your own CSS, you'd have to
stick to a specific size and structure, but I don't think that's such a
bad thing, especially with the possibility of a generator and/or at least
a Photoshop template.
I would think that at least for the menu icon (not really thinking about
the screen icon at the moment - blame that on petemall) we could just use
the same `menu_icon` and `$icon_url` arg/param, as I mentioned in my first
comment. Something like `array( string $url = null, bool $sprite = false,
int $col = null )`, with `$col` being used to calculate horizontal
positioning if specified.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20052#comment:20>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list