WordPress.org

Make WordPress Core

Ticket #21349: 21349-4.patch

File 21349-4.patch, 1.6 KB (added by azaozz, 2 years ago)
  • wp-admin/includes/plugin.php

     
    884884 * @param string $capability The capability required for this menu to be displayed to the user. 
    885885 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 
    886886 * @param callback $function The function to be called to output the content for this page. 
    887  * @param string $icon_url The url to the icon to be used for this menu 
     887 * @param string $icon_url The url to the icon to be used for this menu. Using 'div' would leave div.wp-menu-image empty 
     888 *                         so an icon can be added as background with CSS. 
    888889 * @param int $position The position in the menu order this one should appear 
    889890 * 
    890891 * @return string The resulting page's hook_suffix 
  • wp-admin/menu-header.php

     
    6868                $class = $class ? ' class="' . join( ' ', $class ) . '"' : ''; 
    6969                $id = ! empty( $item[5] ) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : ''; 
    7070                $img = ''; 
     71                // if the string '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. 
    7172                if ( ! empty( $item[6] ) ) 
    7273                        $img = ( 'div' === $item[6] ) ? '<br />' : '<img src="' . $item[6] . '" alt="" />'; 
    7374                $arrow = '<div class="wp-menu-arrow"><div></div></div>';