WordPress.org

Make WordPress Core

Ticket #18085: 18085.patch

File 18085.patch, 530 bytes (added by SergeyBiryukov, 3 years ago)

More simple patch

  • wp-admin/includes/menu.php

     
    216216 
    217217// Remove the last menu item if it is a separator. 
    218218$last_menu_key = array_pop( array_keys( $menu ) ); 
    219 if ( 'wp-menu-separator' == $menu[ $last_menu_key ][ 4 ] ) 
     219if ( !empty( $menu ) && 'wp-menu-separator' == $menu[ $last_menu_key ][ 4 ] ) 
    220220        unset( $menu[ $last_menu_key ] ); 
    221221unset( $last_menu_key ); 
    222222