Make WordPress Core

Changeset 13415


Ignore:
Timestamp:
02/25/2010 10:00:26 PM (15 years ago)
Author:
ryan
Message:

Allow themes to specify a menu fllback other than wp_page_menu(). see #11817

File:
1 edited

Legend:

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

    r13401 r13415  
    99 */
    1010function wp_nav_menu( $args = array() ) {
    11     $defaults = array('id' => '', 'slug' => '', 'menu_class' => 'menu', 'format' => 'div');
     11    $defaults = array('id' => '', 'slug' => '', 'menu_class' => 'menu', 'format' => 'div', 'fallback_cb' => 'wp_page_menu');
    1212    $args = wp_parse_args($args, $defaults);
    1313    $args = (object) $args;
     
    2929
    3030    if ( !$menu || is_wp_error($menu) )
    31         return wp_page_menu( $args );
     31        return call_user_func($args->fallback_cb, $args );
    3232
    3333    if ( 'div' == $args->format )
Note: See TracChangeset for help on using the changeset viewer.