admin管理员组文章数量:1328381
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
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 edited Jan 3, 2014 at 18:17 user1355485 asked Jan 2, 2014 at 22:33 user1355485user1355485 1171 gold badge3 silver badges11 bronze badges 2- download default page icon then set using page_menu_page function. – Ravi Patel Commented Jan 3, 2014 at 9:31
- Related: wordpress.stackexchange/questions/84200/… – Jesse Nickles Commented Mar 3, 2022 at 9:10
2 Answers
Reset to default 9Assuming 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.
<?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:
本文标签: How do I set up the defualt page icon for admin menu
版权声明:本文标题:How do I set up the defualt page icon for admin menu? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742221396a2435464.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论