I install my plugin in several sites and the submenu links generation at backed works fine, but fails in one specific site.
I use the follow code to add the submenu items:
add_menu_page(
'Plugin name',
'Plugin name',
'manage_options',
basename(__FILE__),
'handle_this_action'
);
add_submenu_page(
basename(__FILE__),
'Link 1',
'Link 1',
'manage_options',
basename(__FILE__),
'handle_this_action'
);
This will generate a menu box at backed with one link inside and the main link in the title of menu box. When I click on the main link at menu box I get correctly redirected to my page with a URL like follow:
http://mysite.net/wp-admin/admin.php?page=myplugin.php
But when I click on the submenu link I'm wrongly redirected to:
http://mysite.net/wp-admin/myplugin.php?page=myplugin.php
Instead of: http://mysite.net/wp-admin/admin.php?page=myplugin.php
I really don't know what I have to check in order to figure this out. The WordPress version used in the site that gives me this problem is Version 3.3.1 and I haven't any other plugin activated.
How I can proceed? Any tip or help will be appreciated.


'my_test_string'instead ofbasename(__FILE__)for your slug? – m0r7if3r Feb 14 '12 at 14:15basename()function, just use__FILE__. – Mamaduka Feb 14 '12 at 14:22