Make WordPress Core


Ignore:
Timestamp:
05/09/2013 12:22:02 AM (13 years ago)
Author:
SergeyBiryukov
Message:
  • Pass ellipsis as a parameter to wp_html_excerpt() instead of appending it manually.
  • Consolidate the logic to avoid appending ellipsis if the entire string is shown.
  • Show ellipsis after truncated filenames and post titles.

props solarissmoke, bpetty, SergeyBiryukov. fixes #11446.

File:
1 edited

Legend:

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

    r24185 r24214  
    516516                    <?php foreach ( $menus as $menu ) : ?>
    517517                    <option<?php selected( isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $menu->term_id ); ?>
    518                         value="<?php echo $menu->term_id; ?>"><?php
    519                         $truncated_name = wp_html_excerpt( $menu->name, 40 );
    520                         echo $truncated_name == $menu->name ? $menu->name : trim( $truncated_name ) . '&hellip;';
    521                     ?></option>
     518                        value="<?php echo $menu->term_id; ?>"><?php echo wp_html_excerpt( $menu->name, 40, '&hellip;' ); ?></option>
    522519                    <?php endforeach; ?>
    523520                </select>
Note: See TracChangeset for help on using the changeset viewer.