#7214 closed defect (bug) (fixed)
Allow top-level menu page to use a slug, rather than filename
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 2.7 | Priority: | normal |
| Severity: | normal | Version: | 2.6 |
| Component: | Administration | Keywords: | has-patch needs-testing |
| Focuses: | Cc: |
Description
This patch brings the add_menu_page() into align with the rest of the page addition functions, in that it allows the $file to be any string rather than specifically a filename.
It does look a bit hackish in a sense, But i couldnt see any other way to do it.
It certainly needs testing to check it doesnt adversly affect anything else, but it appears fine to me.
I'll also attach a version of the menu-tester plugin which works after this patch (and doesnt work before it)
Attachments (2)
Change History (7)
#2
@
17 years ago
Any chance of this getting in?
By the looks of it, Only the changes to wp-admin/admin.php need to be applied to the current trunk, That is:
-
wp-admin/admin.php
45 45 46 46 // Handle plugin admin pages. 47 47 if (isset($plugin_page)) { 48 $page_hook = get_plugin_page_hook($plugin_page, $pagenow); 48 if( ! $page_hook = get_plugin_page_hook($plugin_page, $pagenow) ) 49 $page_hook = get_plugin_page_hook($plugin_page, $plugin_page); 49 50 50 51 if ( $page_hook ) { 51 52 do_action('load-' . $page_hook);
Note: See
TracTickets for help on using
tickets.
The change to admin.php could probably be put inside get_plugin_page_hookname somewhere too if need be..