[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 08:14:52 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 kovshenin):
* cc: kovshenin@… (added)
Comment:
They would still need to provide the exact sizes of their sprites for
hidpi, and I also think it's better to use two different image files, so
something this:
{{{
register_post_type( 'my_post_type', array(
'menu_icon' => array(
'image_url' => $image_url,
'image_url_2x' => $image_url_2x,
'background_position' => '100, 200',
'background_position_hover' => '300, 400',
'background_position_2x' => '200, 400', // if not specified
just multiply background_position by two
'background_position_hover_2x ' => '600, 800', // ditto
),
) );
}}}
Back-compat is just a matter of checking whether menu_icon `is_string` and
adding the opacity and background-size things. Any suggestions? I can make
a patch for this.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20052#comment:28>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list