Make WordPress Core

Changeset 14934


Ignore:
Timestamp:
05/26/2010 05:11:46 AM (15 years ago)
Author:
nacin
Message:

Don't store nonexistent (deleted) menus in the auto-add option. see #13447.

Location:
trunk
Files:
3 edited

Legend:

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

    r14924 r14934  
    369369                        unset( $nav_menu_option['auto_add'][$key] );
    370370                }
     371                // Remove nonexistent/deleted menus
     372                $nav_menu_option['auto_add'] = array_intersect( $nav_menu_option['auto_add'], wp_get_nav_menus( array( 'fields' => 'ids' ) ) );
    371373                update_option( 'nav_menu_options', $nav_menu_option );
    372374
  • trunk/wp-includes/nav-menu.php

    r14924 r14934  
    766766
    767767    foreach ( $auto_add as $menu_id ) {
    768         $items = (array) wp_get_nav_menu_items( $menu_id );
     768        $items = wp_get_nav_menu_items( $menu_id );
     769        if ( ! is_array( $items ) )
     770            continue;
    769771        foreach ( $items as $item ) {
    770772            if ( $post->ID == $item->object_id )
  • trunk/wp-includes/taxonomy.php

    r14924 r14934  
    715715 * The 'get_terms_orderby' filter passes the ORDER BY clause for the query
    716716 * along with the $args array.
    717 
     717 *
    718718 * The 'get_terms_fields' filter passes the fields for the SELECT query
    719719 * along with the $args array.
Note: See TracChangeset for help on using the changeset viewer.