Make WordPress Core

12/05/2013 06:37:20 AM (11 years ago)

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.

1 edited


  • trunk/src/wp-includes/post.php

    r26543 r26664  
    11301130 *     * Defaults to null, which places it at the bottom of its area.
    11311131 * - menu_icon - The url to the icon to be used for this menu. Defaults to use the posts icon.
     1132 *     * Pass a base64-encoded SVG using a data URI, which will be colored to match the color scheme.
     1133 *      This should begin with 'data:image/svg+xml;base64,'.
     1134 *     * Pass the name of a Dashicons helper class to use a font icon, e.g. 'dashicons-piechart'.
     1135 *     * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS.
    11321136 * - capability_type - The string to use to build the read, edit, and delete capabilities. Defaults to 'post'.
    11331137 *     * May be passed as an array to allow for alternative plurals when using this argument as a base to construct the
Note: See TracChangeset for help on using the changeset viewer.