WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/09/2013 12:22:02 AM (8 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/edit-comments.php

    r23578 r24214  
    106106
    107107if ( $post_id )
    108     $title = sprintf(__('Comments on “%s”'), wp_html_excerpt(_draft_or_post_title($post_id), 50));
     108    $title = sprintf( __( 'Comments on “%s”' ), wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' ) );
    109109else
    110110    $title = __('Comments');
     
    144144<h2><?php
    145145if ( $post_id )
    146     echo sprintf(__('Comments on &#8220;%s&#8221;'),
    147         sprintf('<a href="%s">%s</a>',
    148             get_edit_post_link($post_id),
    149             wp_html_excerpt(_draft_or_post_title($post_id), 50)
     146    echo sprintf( __( 'Comments on &#8220;%s&#8221;' ),
     147        sprintf( '<a href="%s">%s</a>',
     148            get_edit_post_link( $post_id ),
     149            wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '&hellip;' )
    150150        )
    151151    );
     
    154154
    155155if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
    156     printf( '<span class="subtitle">' . sprintf( __( 'Search results for &#8220;%s&#8221;' ), wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50 ) ) . '</span>' ); ?>
     156    printf( '<span class="subtitle">' . sprintf( __( 'Search results for &#8220;%s&#8221;' ), wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '&hellip;' ) ) . '</span>' ); ?>
    157157</h2>
    158158
Note: See TracChangeset for help on using the changeset viewer.