Make WordPress Core

Changeset 14671


Ignore:
Timestamp:
05/15/2010 08:00:48 PM (14 years ago)
Author:
nacin
Message:

Truncate long menu names in the menu locations box. props koopersmith, see #13378.

File:
1 edited

Legend:

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

    r14645 r14671  
    417417                    <?php foreach ( $menus as $menu ) : ?>
    418418                    <option<?php selected( isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $menu->term_id ); ?>
    419                         value="<?php echo $menu->term_id; ?>"><?php echo $menu->name; ?></option>
     419                        value="<?php echo $menu->term_id; ?>"><?php
     420                        $truncated_name = wp_html_excerpt( $menu->name, 40 );
     421                        echo $truncated_name == $menu->name ? $menu->name : trim( $truncated_name ) . '&hellip;';
     422                    ?></option>
    420423                    <?php endforeach; ?>
    421424                </select>
Note: See TracChangeset for help on using the changeset viewer.