Make WordPress Core

Changeset 15184


Ignore:
Timestamp:
06/09/2010 10:05:27 PM (16 years ago)
Author:
ryan
Message:

Allow assigning an empty menu to a location. fixes #13787

File:
1 edited

Legend:

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

    r15116 r15184  
    163163        $menu_items = wp_get_nav_menu_items( $menu->term_id );
    164164
    165     // If no menu was found or if the menu has no items, call the fallback_cb if it exists
    166     if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) ) )
     165    // If no menu was found or if the menu has no items and no location was requested, call the fallback_cb if it exists
     166    if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) && !$args->theme_location ) )
    167167        && ( function_exists($args->fallback_cb) || is_callable( $args->fallback_cb ) ) )
    168168            return call_user_func( $args->fallback_cb, (array) $args );
Note: See TracChangeset for help on using the changeset viewer.