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

git-svn-id: http://svn.automattic.com/wordpress/trunk@18740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-09-21 20:17:22 +00:00
parent 69a52799a5
commit 9a1be60235
1 changed files with 1 additions and 1 deletions

View File

@ -216,7 +216,7 @@ if ( apply_filters('custom_menu_order', false) ) {
// Remove the last menu item if it is a separator.
$last_menu_key = array_pop( array_keys( $menu ) );
if ( 'wp-menu-separator' == $menu[ $last_menu_key ][ 4 ] )
if ( !empty( $menu ) && 'wp-menu-separator' == $menu[ $last_menu_key ][ 4 ] )
unset( $menu[ $last_menu_key ] );
unset( $last_menu_key );