Ticket #29890: 29890.3.diff
File 29890.3.diff, 1.9 KB (added by , 10 years ago) |
---|
-
src/wp-includes/nav-menu-template.php
151 151 $item_output = $args->before; 152 152 $item_output .= '<a'. $attributes .'>'; 153 153 /** This filter is documented in wp-includes/post-template.php */ 154 $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; 154 $item_output .= $args->link_before; 155 $item_output .= apply_filters( 'the_title', $item->title, $item->ID ); 156 if ( $args->show_description ) { 157 $item_output .= ' <span class="menu-item-description">' . $item->description . '</span>'; 158 } 159 $item_output .= $args->link_after; 155 160 $item_output .= '</a>'; 156 161 $item_output .= $args->after; 157 162 … … 220 225 * in order to be selectable by the user. 221 226 * @type string $items_wrap How the list items should be wrapped. Default is a ul with an id and class. 222 227 * Uses printf() format with numbered placeholders. 228 * @type bool $show_description Whether to show menu item descriptions. Default false. 223 229 * } 224 230 * @return mixed Menu output if $echo is false, false if there are no items or no menu was found. 225 231 */ … … 228 234 229 235 $defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '', 230 236 '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>', 231 'depth' => 0, 'walker' => '', 'theme_location' => '' );237 'depth' => 0, 'walker' => '', 'theme_location' => '', 'show_description' => false ); 232 238 233 239 $args = wp_parse_args( $args, $defaults ); 234 240 /**