Make WordPress Core

Ticket #13910: 13910.diff

File 13910.diff, 1.2 KB (added by wojtek.szkutnik, 15 years ago)
  • nav-menu-template.php

     
    138138
    139139        $defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '',
    140140        'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '',
     141        'title' => '', 'title_before' => '<h2>' , 'title_after' => '</h2>',
    141142        'depth' => 0, 'walker' => '', 'theme_location' => '' );
    142143
    143144        $args = wp_parse_args( $args, $defaults );
     
    200201        $items .= walk_nav_menu_tree( $sorted_menu_items, $args->depth, $args );
    201202        unset($sorted_menu_items);
    202203
     204               
    203205        // Attributes
    204206        if ( ! empty( $args->menu_id ) ) {
    205207                $slug = $args->menu_id;
     
    216218        $attributes = ' id="' . $slug . '"';
    217219        $attributes .= $args->menu_class ? ' class="'. $args->menu_class .'"' : '';
    218220
     221        if ( !empty( $title ) )
     222                $nav_menu .= $title_before . $title . $title_after;
     223               
    219224        $nav_menu .= '<ul'. $attributes .'>';
     225       
    220226
    221227        // Allow plugins to hook into the menu to add their own <li>'s
    222228        $items = apply_filters( 'wp_nav_menu_items', $items, $args );