0

I am working a plugin development. I want to show an icon on the menu Page. I am using the following code :

add_menu_page('pms_rohitashv','PMS','subscriber','pms_rohitashv-main', plugin_dir_url( __FILE__ ).'icon.png');

I am using the plugin icon size 16X16 but the icon shown on the menu is gear icon. I want to change it with the custom icon.

What mistake I am making in the code

1

1 Answer 1

0

You have added the directory name where do you have stored the icon and this should be the 6th argument rather than 5th.

add_menu_page(
    'pms_rohitashv',
    'PMS',
    'subscriber',
    'pms_rohitashv-main',
    '', 
    plugin_dir_url( __FILE__ ).'/images/icon.png'
);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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