Make WordPress Core

Changeset 18740


Ignore:
Timestamp:
09/21/2011 08:17:22 PM (13 years ago)
Author:
ryan
Message:

Avoid notice with empty menu. Props ansimation, SergeyBiryukov. fixes #18085

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/menu.php

    r18109 r18740  
    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 );
Note: See TracChangeset for help on using the changeset viewer.