wordpress add_submenu_page adds broken link
-
Hello
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:
https://mysite.net/wp-admin/admin.php?page=myplugin.php
But when I click on the submenu link I’m wrongly redirected to:
https://mysite.net/wp-admin/myplugin.php?page=myplugin.php
Instead of: https://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.
Regards
Leticia Larrosa
- The topic ‘wordpress add_submenu_page adds broken link’ is closed to new replies.