Ticket #7214: top-level-menu.diff
| File top-level-menu.diff, 1.5 KB (added by , 18 years ago) |
|---|
-
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); -
wp-admin/includes/plugin.php
271 271 272 272 $admin_page_hooks[$file] = sanitize_title( $menu_title ); 273 273 274 $hookname = get_plugin_page_hookname( $file, '');274 $hookname = get_plugin_page_hookname( $file, $file ); 275 275 if (!empty ( $function ) && !empty ( $hookname )) 276 276 add_action( $hookname, $function ); 277 277 … … 299 299 // as the first item in the submenu. If the submenu file is the same as the 300 300 // parent file someone is trying to link back to the parent manually. In 301 301 // this case, don't automatically add a link back to avoid duplication. 302 if (!isset( $submenu[$parent] ) && $file != $parent ) {302 if (!isset( $submenu[$parent] ) && $file != $parent ) { 303 303 foreach ( $menu as $parent_menu ) { 304 304 if ( $parent_menu[2] == $parent && current_user_can( $parent_menu[1] ) ) 305 305 $submenu[$parent][] = $parent_menu;