WordPress.org

Make WordPress Core

Ticket #18232: 18232_v2.patch

File 18232_v2.patch, 1.5 KB (added by bryanjwatson, 9 years ago)
  • nav-menu-template.php

     
    138138        static $menu_id_slugs = array();
    139139
    140140        $defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '',
    141         'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
    142         'depth' => 0, 'walker' => '', 'theme_location' => '' );
     141        'echo' => true, 'fallback_cb' => 'wp_page_menu', 'fallback_args' => '', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '',
     142        'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'depth' => 0, 'walker' => '', 'theme_location' => '' );
    143143
    144144        $args = wp_parse_args( $args, $defaults );
    145145        $args = apply_filters( 'wp_nav_menu_args', $args );
     
    170170        // If no menu was found or if the menu has no items and no location was requested, call the fallback_cb if it exists
    171171        if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) && !$args->theme_location ) )
    172172                && $args->fallback_cb && is_callable( $args->fallback_cb ) )
    173                         return call_user_func( $args->fallback_cb, (array) $args );
     173                        return call_user_func( $args->fallback_cb, (array) $args->fallback_args );
    174174
    175175        // If no fallback function was specified and the menu doesn't exists, bail.
    176176        if ( !$menu || is_wp_error($menu) )