diff --git wp-admin/edit-comments.php wp-admin/edit-comments.php
index 174cd9a..1cacb0d 100644
|
|
|
wp_enqueue_script('admin-comments'); |
| 105 | 105 | enqueue_comment_hotkeys_js(); |
| 106 | 106 | |
| 107 | 107 | if ( $post_id ) |
| 108 | | $title = sprintf(__('Comments on “%s”'), wp_html_excerpt(_draft_or_post_title($post_id), 50)); |
| | 108 | $title = sprintf(__('Comments on “%s”'), |
| | 109 | wp_html_excerpt( _draft_or_post_title($post_id), 50, |
| | 110 | array( 'append_ellipsis' => true ) ) ); |
| 109 | 111 | else |
| 110 | 112 | $title = __('Comments'); |
| 111 | 113 | |
| … |
… |
if ( $post_id ) |
| 146 | 148 | echo sprintf(__('Comments on “%s”'), |
| 147 | 149 | sprintf('<a href="%s">%s</a>', |
| 148 | 150 | get_edit_post_link($post_id), |
| 149 | | wp_html_excerpt(_draft_or_post_title($post_id), 50) |
| | 151 | wp_html_excerpt( _draft_or_post_title($post_id), 50, |
| | 152 | array( 'append_ellipsis' => true ) ) |
| 150 | 153 | ) |
| 151 | 154 | ); |
| 152 | 155 | else |
| 153 | 156 | echo __('Comments'); |
| 154 | 157 | |
| 155 | 158 | if ( isset($_REQUEST['s']) && $_REQUEST['s'] ) |
| 156 | | printf( '<span class="subtitle">' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ) . '</span>' ); ?> |
| | 159 | printf( '<span class="subtitle">' . |
| | 160 | sprintf( __( 'Search results for “%s”' ), |
| | 161 | wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50, |
| | 162 | array( 'append_ellipsis' => true ) ) ) . |
| | 163 | '</span>' ); ?> |
| 157 | 164 | </h2> |
| 158 | 165 | |
| 159 | 166 | <?php |
diff --git wp-admin/includes/dashboard.php wp-admin/includes/dashboard.php
index 0df8109..59a7539 100644
|
|
|
function wp_dashboard_incoming_links_output() { |
| 827 | 827 | $publisher = "<strong>$publisher</strong>"; |
| 828 | 828 | |
| 829 | 829 | $content = $item->get_content(); |
| 830 | | $content = wp_html_excerpt($content, 50) . ' ...'; |
| | 830 | $content = wp_html_excerpt( $content, 50, array( 'append_ellipsis' => true ) ); |
| 831 | 831 | |
| 832 | 832 | if ( $link ) |
| 833 | 833 | /* translators: incoming links feed, %1$s is other person, %3$s is content */ |
diff --git wp-admin/includes/media.php wp-admin/includes/media.php
index beb3dcc..f531442 100644
|
|
|
function get_media_item( $attachment_id, $args = null ) { |
| 1108 | 1108 | } |
| 1109 | 1109 | |
| 1110 | 1110 | $display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case |
| 1111 | | $display_title = $show_title ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60 ) . "</span></div>" : ''; |
| | 1111 | $display_title = "<div class='filename new'><span class='title'>" . |
| | 1112 | wp_html_excerpt( $display_title, 60, |
| | 1113 | array( 'append_ellipsis' => true ) ) . |
| | 1114 | "</span></div>"; |
| | 1115 | if ( ! $show_title ) { |
| | 1116 | $display_title = ''; |
| | 1117 | } |
| 1112 | 1118 | |
| 1113 | 1119 | $gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' == $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' == $redir_tab ) ); |
| 1114 | 1120 | $order = ''; |
diff --git wp-admin/includes/nav-menu.php wp-admin/includes/nav-menu.php
index 6064462..9b4247e 100644
|
|
|
function wp_nav_menu_locations_meta_box() { |
| 501 | 501 | <?php foreach ( $menus as $menu ) : ?> |
| 502 | 502 | <option<?php selected( isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $menu->term_id ); ?> |
| 503 | 503 | value="<?php echo $menu->term_id; ?>"><?php |
| 504 | | $truncated_name = wp_html_excerpt( $menu->name, 40 ); |
| 505 | | echo $truncated_name == $menu->name ? $menu->name : trim( $truncated_name ) . '…'; |
| | 504 | echo wp_html_excerpt( $menu->name, 40, array( 'append_ellipsis' => true ) ); |
| 506 | 505 | ?></option> |
| 507 | 506 | <?php endforeach; ?> |
| 508 | 507 | </select> |
diff --git wp-admin/nav-menus.php wp-admin/nav-menus.php
index 361d0f6..50d2e68 100644
|
|
|
if ( ! $nav_menu_selected_title && is_nav_menu( $nav_menu_selected_id ) ) { |
| 405 | 405 | |
| 406 | 406 | // Generate truncated menu names |
| 407 | 407 | foreach( (array) $nav_menus as $key => $_nav_menu ) { |
| 408 | | $_nav_menu->truncated_name = trim( wp_html_excerpt( $_nav_menu->name, 40 ) ); |
| 409 | | if ( $_nav_menu->truncated_name != $_nav_menu->name ) |
| 410 | | $_nav_menu->truncated_name .= '…'; |
| 411 | | |
| | 408 | $_nav_menu->truncated_name = trim( wp_html_excerpt( $_nav_menu->name, 40, array( 'append_ellipsis' => true ) ) ); |
| 412 | 409 | $nav_menus[$key]->truncated_name = $_nav_menu->truncated_name; |
| 413 | 410 | } |
| 414 | 411 | |
diff --git wp-includes/comment.php wp-includes/comment.php
index 09bad3c..1d043ad 100644
|
|
|
function do_trackbacks($post_id) { |
| 1756 | 1756 | else |
| 1757 | 1757 | $excerpt = apply_filters('the_excerpt', $post->post_excerpt); |
| 1758 | 1758 | $excerpt = str_replace(']]>', ']]>', $excerpt); |
| 1759 | | $excerpt = wp_html_excerpt($excerpt, 252) . '...'; |
| | 1759 | $excerpt = wp_html_excerpt( $excerpt, 252, array( 'append_ellipsis' => true ) ); |
| 1760 | 1760 | |
| 1761 | 1761 | $post_title = apply_filters('the_title', $post->post_title, $post->ID); |
| 1762 | 1762 | $post_title = strip_tags($post_title); |
diff --git wp-includes/formatting.php wp-includes/formatting.php
index a0e9994..69be2e9 100644
|
|
|
function wp_sprintf_l($pattern, $args) { |
| 3084 | 3084 | * be counted as one character. For example & will be counted as 4, < as |
| 3085 | 3085 | * 3, etc. |
| 3086 | 3086 | * |
| | 3087 | * The list of arguments that $options can contain, which will overwrite the |
| | 3088 | * defaults: |
| | 3089 | * |
| | 3090 | * append_ellipsis - Whether to append truncated string with an ellipsis. |
| | 3091 | * Defaults to false. |
| | 3092 | * |
| 3087 | 3093 | * @since 2.5.0 |
| 3088 | 3094 | * |
| 3089 | 3095 | * @param integer $str String to get the excerpt from. |
| 3090 | 3096 | * @param integer $count Maximum number of characters to take. |
| | 3097 | * @param string|array $options Additional options affecting extracted output. |
| 3091 | 3098 | * @return string The excerpt. |
| 3092 | 3099 | */ |
| 3093 | | function wp_html_excerpt( $str, $count ) { |
| | 3100 | function wp_html_excerpt( $str, $count, $options = '' ) { |
| | 3101 | $defaults = array( |
| | 3102 | 'append_ellipsis' => false |
| | 3103 | ); |
| | 3104 | $options = wp_parse_args( $options, $defaults ); |
| 3094 | 3105 | $str = wp_strip_all_tags( $str, true ); |
| 3095 | | $str = mb_substr( $str, 0, $count ); |
| | 3106 | $new_str = mb_substr( $str, 0, $count ); |
| 3096 | 3107 | // remove part of an entity at the end |
| 3097 | | $str = preg_replace( '/&[^;\s]{0,6}$/', '', $str ); |
| 3098 | | return $str; |
| | 3108 | $new_str = preg_replace( '/&[^;\s]{0,6}$/', '', $new_str ); |
| | 3109 | if( $options['append_ellipsis'] && strlen( $new_str ) < strlen( $str ) ) |
| | 3110 | $new_str .= '…'; |
| | 3111 | return $new_str; |
| 3099 | 3112 | } |
| 3100 | 3113 | |
| 3101 | 3114 | /** |
diff --git wp-trackback.php wp-trackback.php
index 06e4750..d31b21e 100644
|
|
|
if ( !empty($tb_url) && !empty($title) ) { |
| 87 | 87 | if ( !pings_open($tb_id) ) |
| 88 | 88 | trackback_response(1, 'Sorry, trackbacks are closed for this item.'); |
| 89 | 89 | |
| 90 | | $title = wp_html_excerpt( $title, 250 ).'...'; |
| 91 | | $excerpt = wp_html_excerpt( $excerpt, 252 ).'...'; |
| | 90 | $title = wp_html_excerpt( $title, 250, array( 'append_ellipsis' => true ) ); |
| | 91 | $excerpt = wp_html_excerpt( $excerpt, 252, array( 'append_ellipsis' => true ) ); |
| 92 | 92 | |
| 93 | 93 | $comment_post_ID = (int) $tb_id; |
| 94 | 94 | $comment_author = $blog_name; |