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. Built from https://develop.svn.wordpress.org/trunk@26664 git-svn-id: http://core.svn.wordpress.org/trunk@26554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -966,8 +966,11 @@ function uninstall_plugin($plugin) {
|
||||
* @param string $capability The capability required for this menu to be displayed to the user.
|
||||
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
|
||||
* @param callback $function The function to be called to output the content for this page.
|
||||
* @param string $icon_url The url to the icon to be used for this menu. Using 'none' would leave div.wp-menu-image empty
|
||||
* so an icon can be added as background with CSS.
|
||||
* @param string $icon_url The url to the icon to be used for this menu.
|
||||
* * Pass a base64-encoded SVG using a data URI, which will be colored to match the color scheme.
|
||||
* This should begin with 'data:image/svg+xml;base64,'.
|
||||
* * Pass the name of a Dashicons helper class to use a font icon, e.g. 'dashicons-piechart'.
|
||||
* * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS.
|
||||
* @param int $position The position in the menu order this one should appear
|
||||
*
|
||||
* @return string The resulting page's hook_suffix
|
||||
|
||||
Reference in New Issue
Block a user