Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r19658 r20513  
    3838         * @param int $depth Depth of page. Used for padding.
    3939         */
    40         function start_lvl(&$output, $depth) {
     40        function start_lvl( &$output, $depth = 0, $args = array() ) {
    4141                $indent = str_repeat("\t", $depth);
    4242                $output .= "\n$indent<ul class=\"sub-menu\">\n";
    … …  
    5050         * @param int $depth Depth of page. Used for padding.
    5151         */
    52         function end_lvl(&$output, $depth) {
     52        function end_lvl( &$output, $depth = 0, $args = array() ) {
    5353                $indent = str_repeat("\t", $depth);
    5454                $output .= "$indent</ul>\n";
    … …  
    6565         * @param object $args
    6666         */
    67         function start_el(&$output, $item, $depth, $args) {
     67        function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
    6868                global $wp_query;
    6969                $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
    … …  
    7575
    7676                $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
    77                 $class_names = ' class="' . esc_attr( $class_names ) . '"';
     77                $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
    7878
    7979                $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
    80                 $id = strlen( $id ) ? ' id="' . esc_attr( $id ) . '"' : '';
     80                $id = $id ? ' id="' . esc_attr( $id ) . '"' : '';
    8181
    8282                $output .= $indent . '<li' . $id . $value . $class_names .'>';
    … …  
    104104         * @param int $depth Depth of page. Not Used.
    105105         */
    106         function end_el(&$output, $item, $depth) {
     106        function end_el( &$output, $item, $depth = 0, $args = array() ) {
    107107                $output .= "</li>\n";
    108108        }
    … …  
    114114 * Optional $args contents:
    115115 *
    116  * menu - The menu that is desired.  Accepts (matching in order) id, slug, name. Defaults to blank.
     116 * menu - The menu that is desired. Accepts (matching in order) id, slug, name. Defaults to blank.
    117117 * menu_class - CSS class to use for the ul element which forms the menu. Defaults to 'menu'.
    118118 * menu_id - The ID that is applied to the ul element which forms the menu. Defaults to the menu slug, incremented.
    … …  
    126126 * link_after - Text after the link.
    127127 * echo - Whether to echo the menu or return it. Defaults to echo.
    128  * depth - how many levels of the hierarchy are to be included.  0 means all. Defaults to 0.
     128 * depth - how many levels of the hierarchy are to be included. 0 means all. Defaults to 0.
    129129 * walker - allows a custom walker to be specified.
    130  * theme_location - the location in the theme to be used.  Must be registered with register_nav_menu() in order to be selectable by the user.
     130 * theme_location - the location in the theme to be used. Must be registered with register_nav_menu() in order to be selectable by the user.
    131131 * items_wrap - How the list items should be wrapped. Defaults to a ul with an id and class. Uses printf() format with numbered placeholders.
    132132 *
Note: See TracChangeset for help on using the changeset viewer.