Ticket #13220: truncate.menu.names.3.patch
File truncate.menu.names.3.patch, 1.4 KB (added by , 14 years ago) |
---|
-
wp-admin/nav-menus.php
302 302 $nav_menu_selected_title = ! is_wp_error( $_menu_object ) ? $_menu_object->name : ''; 303 303 } 304 304 305 // Generate truncated menu names 306 foreach( (array) $nav_menus as $_nav_menu ) { 307 $_nav_menu->truncated_name = trim( wp_html_excerpt( $_nav_menu->name, 40 ) ); 308 if ( $_nav_menu->truncated_name != $_nav_menu->name ) 309 $_nav_menu->truncated_name .= '…'; 310 } 311 305 312 // The theme supports menus 306 313 if ( current_theme_supports('nav-menus') ) { 307 314 // Set up nav menu … … 353 360 <select id="select-nav-menu" name="menu"> 354 361 <?php foreach( (array) $nav_menus as $_nav_menu ) : ?> 355 362 <option value="<?php echo esc_attr($_nav_menu->term_id) ?>" <?php selected($nav_menu_selected_id, $_nav_menu->term_id); ?>> 356 <?php echo esc_html( $_nav_menu-> name ); ?>363 <?php echo esc_html( $_nav_menu->truncated_name ); ?> 357 364 </option> 358 365 <?php endforeach; ?> 359 366 <option value="0"><?php esc_html_e('Add New Menu'); ?></option> … … 380 387 echo ' nav-tab-active'; 381 388 else 382 389 echo ' hide-if-no-js'; 383 ?>"><?php echo esc_html( $_nav_menu-> name ); ?></a><?php390 ?>"><?php echo esc_html( $_nav_menu->truncated_name ); ?></a><?php 384 391 endforeach; 385 392 ?><a href="<?php 386 393 echo add_query_arg(