Make WordPress Core

Ticket #5001: admin-menu.diff

File admin-menu.diff, 2.1 KB (added by jhodgdon, 17 years ago)

Patches to fix this problem

  • E:/EclipseWorkWeb/WordPressDev/wp-admin/menu-header.php

     
    33$self = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
    44$self = preg_replace('|^.*/plugins/|i', '', $self);
    55
     6// Reset parent file variable, as it may be set incorrectly
     7// during plugin inits
     8$parent_file = '';
     9
    610get_admin_page_parent();
    711
    812foreach ($menu as $item) {
  • E:/EclipseWorkWeb/WordPressDev/wp-admin/includes/plugin.php

     
    217217                                $parent_file = $parent;
    218218                                return $parent;
    219219                        } else
    220                                 if ( isset( $plugin_page ) && ($plugin_page == $submenu_array[2] ) ) {
     220                                if ( isset( $plugin_page ) && ($plugin_page == $submenu_array[2] )
     221                                        && (( $pagenow == $parent ) || ( $pagenow == 'admin.php'))) {
    221222                                        $parent_file = $parent;
    222223                                        return $parent;
    223224                                }
     
    299300function get_plugin_page_hookname( $plugin_page, $parent_page ) {
    300301        global $admin_page_hooks;
    301302
     303        $parent_file = '';
    302304        $parent = get_admin_page_parent();
    303305
    304306        if ( empty ( $parent_page ) || 'admin.php' == $parent_page ) {
  • E:/EclipseWorkWeb/WordPressDev/wp-admin/admin.php

     
    4141if (isset($plugin_page)) {
    4242        $page_hook = get_plugin_page_hook($plugin_page, $pagenow);
    4343
     44        // if this did not work, try using the parent file instead of $pagenow, which is probably set to admin.php
     45        if( !$page_hook ) {
     46                $page_hook = get_plugin_page_hook( $plugin_page, $parent_file );
     47        }
     48
    4449        if ( $page_hook ) {
    4550                do_action('load-' . $page_hook);
    4651                if (! isset($_GET['noheader']))