Ticket #13220: truncate.menu.names.1.patch
File truncate.menu.names.1.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 = ( strlen($_nav_menu->name) > 40 ) ? substr( $_nav_menu->name, 0, 40 ) . '...' : $_nav_menu->name; 308 } 309 305 310 // The theme supports menus 306 311 if ( current_theme_supports('nav-menus') ) { 307 312 // Set up nav menu … … 353 358 <select id="select-nav-menu" name="menu"> 354 359 <?php foreach( (array) $nav_menus as $_nav_menu ) : ?> 355 360 <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 ); ?>361 <?php echo esc_html( $_nav_menu->truncated_name ); ?> 357 362 </option> 358 363 <?php endforeach; ?> 359 364 <option value="0"><?php esc_html_e('Add New Menu'); ?></option> … … 380 385 echo ' nav-tab-active'; 381 386 else 382 387 echo ' hide-if-no-js'; 383 ?>"><?php echo esc_html( $_nav_menu-> name );?></a><?php388 ?>"><?php echo esc_html( $_nav_menu->truncated_name )?></a><?php 384 389 endforeach; 385 390 ?><a href="<?php 386 391 echo add_query_arg(