#14159 closed defect (bug) (fixed)
menu_page_url not returning correct URL for custom submenus
| Reported by: | williamsba1 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1 |
| Component: | Plugins | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | administration |
Description
When using the menu_page_url() function to determine the URL to a submenu of a custom top-level menu it's not returning the correct URL.
The function returns:
http://example.com/wp-admin/cpt_main_menu?page=cpt_sub_add_new
The correct URL is:
http://example.com/wp-admin/admin.php?page=cpt_sub_add_new
For reference my submenu is registered like so:
add_submenu_page('cpt_main_menu', 'Add New', 'Add New', 'administrator', 'cpt_sub_add_new', 'cpt_add_new');
I tested this on the custom top level menu and the URL returned is correct. It only appears to be an issue with submenus of a custom top level menu
Attachments (1)
Change History (10)
#4
@
16 years ago
Was also thinking of trying to get menu_page_url to work for the predefined menu slugs (e.g. tools.php)
Future?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
If the menu item's parent is unset then it's a submenu of a builtin menu otherwise it also has an admin.php URL.
Was also thinking of trying to get menu_page_url to work for the predefined menu slugs (e.g. tools.php)
Updated unit-tests at #UT10