Changes from branches/3.3/wp-includes/nav-menu-template.php at r19658 to trunk/wp-includes/nav-menu-template.php at r20513
- File:
-
- 1 edited
-
trunk/wp-includes/nav-menu-template.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/nav-menu-template.php
r19658 r20513 38 38 * @param int $depth Depth of page. Used for padding. 39 39 */ 40 function start_lvl( &$output, $depth) {40 function start_lvl( &$output, $depth = 0, $args = array() ) { 41 41 $indent = str_repeat("\t", $depth); 42 42 $output .= "\n$indent<ul class=\"sub-menu\">\n"; … … 50 50 * @param int $depth Depth of page. Used for padding. 51 51 */ 52 function end_lvl( &$output, $depth) {52 function end_lvl( &$output, $depth = 0, $args = array() ) { 53 53 $indent = str_repeat("\t", $depth); 54 54 $output .= "$indent</ul>\n"; … … 65 65 * @param object $args 66 66 */ 67 function start_el( &$output, $item, $depth, $args) {67 function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { 68 68 global $wp_query; 69 69 $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; … … 75 75 76 76 $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 ) . '"' : ''; 78 78 79 79 $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 ) . '"' : ''; 81 81 82 82 $output .= $indent . '<li' . $id . $value . $class_names .'>'; … … 104 104 * @param int $depth Depth of page. Not Used. 105 105 */ 106 function end_el( &$output, $item, $depth) {106 function end_el( &$output, $item, $depth = 0, $args = array() ) { 107 107 $output .= "</li>\n"; 108 108 } … … 114 114 * Optional $args contents: 115 115 * 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. 117 117 * menu_class - CSS class to use for the ul element which forms the menu. Defaults to 'menu'. 118 118 * menu_id - The ID that is applied to the ul element which forms the menu. Defaults to the menu slug, incremented. … … 126 126 * link_after - Text after the link. 127 127 * 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. 129 129 * 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. 131 131 * items_wrap - How the list items should be wrapped. Defaults to a ul with an id and class. Uses printf() format with numbered placeholders. 132 132 *
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)