How to insert Wordpress own icons in the administrative area menu?

0

How do I set icons for Wordpress itself, which is located on the 10 line of this function?

add_action('admin_menu', 'pagina_gerencia');

function pagina_gerencia() {
    add_menu_page (
    'Gerência de dados',
    'Gerência',
        'manage_options',
        'danton_traduttions/danton_traduttions.php',
        '',
        'div', // <-- linha 10
        6
    );
}
    
asked by anonymous 02.10.2014 / 02:08

1 answer

1

Just use one of the dashicons.css , as dashicons-chart-pie or dashicons-welcome-learn-more :

add_action('admin_menu', function() {
    # $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '', $position = null
    add_menu_page (
        'Gerência de dados',
        'Gerência',
        'manage_options',
        'gerencia_de_dados',
        function(){ echo '<h1>menu</h1>'; },
        'dashicons-welcome-learn-more',
        6
    );
});

You can also place a URL, a base64-encoded SVG or leave empty to do with CSS.

    
02.10.2014 / 02:27