Make WordPress Core


Ignore:
Timestamp:
09/16/2012 10:51:44 PM (12 years ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/menu-header.php

    r21574 r21877  
    6969        $id = ! empty( $item[5] ) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : '';
    7070        $img = '';
     71        // if the string 'none' (previously 'div') is passed instead of an URL, don't output the default menu image
     72        // so an icon can be added to div.wp-menu-image as background with CSS.
    7173        if ( ! empty( $item[6] ) )
    72             $img = ( 'div' === $item[6] ) ? '<br />' : '<img src="' . $item[6] . '" alt="" />';
     74            $img = ( 'none' === $item[6] || 'div' === $item[6] ) ? '<br />' : '<img src="' . $item[6] . '" alt="" />';
    7375        $arrow = '<div class="wp-menu-arrow"><div></div></div>';
    7476
Note: See TracChangeset for help on using the changeset viewer.