Make WordPress Core


Ignore:
Timestamp:
06/11/2011 03:52:15 PM (13 years ago)
Author:
ryan
Message:

Improvements to invalid menu item handling. Props ocean90. fixes #13958

File:
1 edited

Legend:

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

    r18260 r18277  
    11041104            return new WP_Error( 'menu_walker_not_exist', sprintf( __('The Walker class named <strong>%s</strong> does not exist.'), $walker_class_name ) );
    11051105
    1106         $some_pending_menu_items = false;
     1106        $some_pending_menu_items = $some_invalid_menu_items = false;
    11071107        foreach( (array) $menu_items as $menu_item ) {
    11081108            if ( isset( $menu_item->post_status ) && 'draft' == $menu_item->post_status )
    11091109                $some_pending_menu_items = true;
     1110            if ( ! empty( $menu_item->_invalid ) )
     1111                $some_invalid_menu_items = true;
    11101112        }
    11111113
    11121114        if ( $some_pending_menu_items )
    11131115            $result .= '<div class="updated inline"><p>' . __('Click Save Menu to make pending menu items public.') . '</p></div>';
     1116
     1117        if ( $some_invalid_menu_items )
     1118            $result .= '<div class="error inline"><p>' . __('There are some invalid menu items. Please check or delete them.') . '</p></div>';
    11141119
    11151120        $result .= '<ul class="menu" id="menu-to-edit"> ';
Note: See TracChangeset for help on using the changeset viewer.