Make WordPress Core

Ticket #48599: 48599.1.diff

File 48599.1.diff, 644 bytes (added by garrett-eclipse, 6 years ago)

Patch to test the theory it's the parent and menu slugs being identical causing $submenu[ $parent_slug ] to be undefined

  • src/wp-admin/includes/plugin.php

     
    13911391                $submenu[ $parent_slug ][] = $new_sub_menu;
    13921392        } else {
    13931393                // If position is equal or higher than the number of items in the array, append the submenu.
    1394                 if ( $position >= count( $submenu[ $parent_slug ] ) ) {
     1394                if ( ! isset( $submenu[ $parent_slug ] ) || $position >= count( $submenu[ $parent_slug ] ) ) {
    13951395                        $submenu[ $parent_slug ][] = $new_sub_menu;
    13961396                } else {
    13971397                        // Test for a negative position.