Admin menu: add phpdoc/inline comments describing the usage of the param $icon_url in add_menu_page(), add string 'none' to be used when a menu icon is added from CSS, switch core items in the admin menu to use 'none', fixes #21349

git-svn-id: https://develop.svn.wordpress.org/trunk@21877 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2012-09-16 22:51:44 +00:00
parent 411e45256a
commit 7485a0ceed
3 changed files with 19 additions and 16 deletions

View File

@@ -68,8 +68,10 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
$class = $class ? ' class="' . join( ' ', $class ) . '"' : '';
$id = ! empty( $item[5] ) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : '';
$img = '';
// if the string 'none' (previously 'div') is passed instead of an URL, don't output the default menu image
// so an icon can be added to div.wp-menu-image as background with CSS.
if ( ! empty( $item[6] ) )
$img = ( 'div' === $item[6] ) ? '<br />' : '<img src="' . $item[6] . '" alt="" />';
$img = ( 'none' === $item[6] || 'div' === $item[6] ) ? '<br />' : '<img src="' . $item[6] . '" alt="" />';
$arrow = '<div class="wp-menu-arrow"><div></div></div>';
$title = wptexturize( $item[0] );