How do I set up the defualt page icon for admin menu?

What do i Change this to So its shows the default page icon?', plugins_url( 'myplugin/images/icon.png' )

 add_menu_page( 'Info', 'Info', 'manage_options', 'LINK', '', plugins_url( 'myplugin/images/icon.png' ), 10 );

I find out how to do this.

Read More

Step 1. Screenshot or find the image you like.

Step 2. Name it icon.png

step 3. Create a folder myplugin inside the plugin folder and then create inside that folder images folder and then put the icon.png image inside the image folder and thats it.

in short plugin > myplugin > image > icon.png

Related posts

2 comments

  1. Assuming you’re running WP 3.8, you can choose from a collection of icons (listed here). In your case, replace your icon URL with dashicons-admin-page, like so:

     add_menu_page( 'Info', 'Info', 'manage_options', 'LINK', '', 'dashicons-admin-page', 10 );
    

    You can use these icons in various places around WP. There are various articles on this like this one.

  2. <?php add_menu_page( $page_title, $menu_title, $capability,
     $menu_slug, $function, $icon_url, $position ); ?> 
    
    
    <?php  add_menu_page( 'My Page Title', 'My Page', 'edit_others_posts',
     'my_page_slug', 'my_page_function', plugins_url( 'myplugin/images/icon.png' ), 6 );  ?>
    

    moreinfo:

Comments are closed.