WordPress.org

Make WordPress Core

Ticket #15595: 15595.patch

File 15595.patch, 670 bytes (added by toddhuish, 7 years ago)

Patch to alleviate the menu item collision described

  • plugin.php

     
    836836        $new_menu = array( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
    837837
    838838        if ( null === $position  )
     839        {
    839840                $menu[] = $new_menu;
     841        }
    840842        else
     843        {
     844                //In case of position collision, push the conflicting menu to the next open position
     845                while(isset($menu[$position]))
     846                {
     847                        $position++;
     848                }
     849               
    841850                $menu[$position] = $new_menu;
    842 
     851        }
    843852        $_registered_pages[$hookname] = true;
    844 
     853       
    845854        // No parent as top level
    846855        $_parent_pages[$menu_slug] = false;
    847856