Make WordPress Core


Ignore:
Timestamp:
12/05/2013 06:37:20 AM (11 years ago)
Author:
nacin
Message:

Allow for Dashicons and base64-encoded data:image/svg+xml URIs when specifying menu icons.

Both of these icons can be colored to match the color scheme, including hover states.
Both are accepted for register_post_type()'s menu_icon argument, and also add_menu_page()'s $icon_url argument.

To use a Dashicon, pass the name of the helper class, e.g. 'dashicons-piechart'.
To use an SVG, pass a valid data URI string starting with 'data:image/svg+xml;base64,'.

props helen.
fixes #25147.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r26590 r26664  
    967967 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    968968 * @param callback $function The function to be called to output the content for this page.
    969  * @param string $icon_url The url to the icon to be used for this menu. Using 'none' would leave div.wp-menu-image empty
    970  *                         so an icon can be added as background with CSS.
     969 * @param string $icon_url The url to the icon to be used for this menu.
     970 *     * Pass a base64-encoded SVG using a data URI, which will be colored to match the color scheme.
     971 *       This should begin with 'data:image/svg+xml;base64,'.
     972 *     * Pass the name of a Dashicons helper class to use a font icon, e.g. 'dashicons-piechart'.
     973 *     * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS.
    971974 * @param int $position The position in the menu order this one should appear
    972975 *
Note: See TracChangeset for help on using the changeset viewer.