Custom svg admin menu icon in WordPress
I got the solution by analyzing Woocommerce. If no url is supplied to the add_menu_page
function, WordPress uses the default dashicon. So it's just a matter of overriding the default style. Like add this to admin styles:
#adminmenu #toplevel_page_yourpageid .menu-icon-generic div.wp-menu-image:before {
font-family: your_font !important;
content: '\eiconid';
font-size: 1.3em!important;
}
I converted svg to font on Icomoon.
WordPress Custom Theme Favicon in Dashboard Menu
I figured this one out. Hopefully it can help others:
add_menu_page('Page title', 'Top-level menu title',
'administrator', 'my-top-level-handle',
'my_magic_function','../wp-content/themes/yourTheme/img/favicon.png');
You can also add a submenu under your theme's main menu item like so...
add_submenu_page( 'my-top-level-handle', 'Page title',
'Sub-menu title', 'administrator', 'my-submenu-handle', 'my_magic_function')
How can i add new item to wordpress sidemenu, with icon on it
refrence https://core.trac.wordpress.org/browser/tags/3.2.1/wp-admin/menu.php
<?php
add_action('admin_init', 'logout_menu_item_link');
function logout_menu_item_link() {
global $menu;
$menu[9999] = array(__('Logout'), 'read', wp_logout_url(),'','custom-class','custom-id','dashicons-external');
}
Related Topics
How to Decode Base64-Encoded Font Information
Is Is Possible to Scale Inline Svg with CSS
How to Make Shadow on Border-Bottom
Position:Sticky Is Not Working
CSS Filter Grayscale Image for Ie 10
Css: How to Set Container Size Equal to Background Image Size
Css: Background Position with Repeat
Why Can't I Override Existing Pseudo-Elements
Create CSS to Enlarge Checkboxes
How to Set the Size of an HTML Text Box
Centering No Captcha Recaptcha
Flex-Wrap Not Working as Expected in Safari
Changing Font-Family for Placeholder
How to Get a Floating-Div to Fill Available Space Within Its Parent Div
Changing Font Color of <A> Contained Within <Li>, But on Hover Over <Li>
Angular2: How to Manually Add CSS Files by Condition to Index.Html