Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

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

share|improve this question
    
download default page icon then set using page_menu_page function. –  ravi patel Jan 3 at 9:31

2 Answers 2

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.

share|improve this answer
    
I need the default page icon. Not a new icon. –  user1355485 Jan 3 at 2:52
    
@user1355485 The admin menu uses Dashicons, so this should be the default icon for the Pages menu item. I hope you are trying the example first. If that's not the icon you're looking for, you may need to elaborate on what you mean by default or by page. –  helenhousandi Jan 3 at 15:38
    
OP - @helenhousandi is right. My suggestion should work and the link to the Dashicons repository is what Wordpress uses for all the WP-Admin icons. –  Strap1 Jan 3 at 16:00
<?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:

share|improve this answer
    
Please add some details what this code block is and how it's functioning, then paste the code and link for further details. It's to make the answer more informative rather a simple code block. Thnaks. –  Mayeenul Islam Jan 3 at 10:28
    
    
Edit the answer and add details. Please don't misuse the comment area. –  Mayeenul Islam Jan 3 at 10:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.