[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 19:09:51 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 kovshenin):

 Replying to [comment:35 bradyvercher]:

 > All the patch really needs to be concerned with (in this instance,
 regarding post types) is whether or not 'menu_icon' is an array
 That's exactly what it's doing, and if it's a string (back-compat) then
 it's converting it to an array. Try and apply the patch to the current
 codebase and check the gist I posted to see how it works.

 > The logical comparisons should be switched according to the coding
 standards
 Maybe, though yoda conditions are more common when comparing a variable,
 the current code compares a literal to a function, so it doesn't really
 matter, but we can then iterate on making the code cleaner. The current
 patch is more of a proof-of-concept and not a commit candidate.

 Replying to [comment:36 azaozz]:

 I think you're right, after writing this patch and after doing it manually
 in a plugin, there really isn't any difficulty of rolling your own
 admin_head, in fact the latter feel easier than having to learn new
 function arguments. 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.

 Maybe we should just write some clear instructions in the Codex about
 hovers and 2x. Thoughts?

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


More information about the wp-trac mailing list