Changeset 24214
- Timestamp:
- 05/09/2013 12:22:02 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/async-upload.php
r22915 r24214 58 58 echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>'; 59 59 $title = $post->post_title ? $post->post_title : wp_basename( $post->guid ); // title shouldn't ever be empty, but use filename just in cas.e 60 echo '<div class="filename new"><span class="title">' . esc_html( wp_html_excerpt( $title, 60 ) ) . '</span></div>';60 echo '<div class="filename new"><span class="title">' . esc_html( wp_html_excerpt( $title, 60, '…' ) ) . '</span></div>'; 61 61 break; 62 62 case 2 : -
trunk/wp-admin/edit-comments.php
r23578 r24214 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”' ), wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' ) ); 109 109 else 110 110 $title = __('Comments'); … … 144 144 <h2><?php 145 145 if ( $post_id ) 146 echo sprintf( __('Comments on “%s”'),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 “%s”' ), 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, '…' ) 150 150 ) 151 151 ); … … 154 154 155 155 if ( isset($_REQUEST['s']) && $_REQUEST['s'] ) 156 printf( '<span class="subtitle">' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50 ) ) . '</span>' ); ?>156 printf( '<span class="subtitle">' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '…' ) ) . '</span>' ); ?> 157 157 </h2> 158 158 -
trunk/wp-admin/includes/dashboard.php
r24212 r24214 828 828 829 829 $content = $item->get_content(); 830 $content = wp_html_excerpt( $content, 50) . ' …';830 $content = wp_html_excerpt( $content, 50, ' …' ); 831 831 832 832 if ( $link ) -
trunk/wp-admin/includes/media.php
r24187 r24214 1160 1160 1161 1161 $display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case 1162 $display_title = $show_title ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60 ) . "</span></div>" : '';1162 $display_title = $show_title ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60, '…' ) . "</span></div>" : ''; 1163 1163 1164 1164 $gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' == $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' == $redir_tab ) ); -
trunk/wp-admin/includes/nav-menu.php
r24185 r24214 516 516 <?php foreach ( $menus as $menu ) : ?> 517 517 <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 ) . '…'; 521 ?></option> 518 value="<?php echo $menu->term_id; ?>"><?php echo wp_html_excerpt( $menu->name, 40, '…' ); ?></option> 522 519 <?php endforeach; ?> 523 520 </select> -
trunk/wp-admin/nav-menus.php
r24183 r24214 437 437 // Generate truncated menu names 438 438 foreach( (array) $nav_menus as $key => $_nav_menu ) { 439 $_nav_menu->truncated_name = trim( wp_html_excerpt( $_nav_menu->name, 40 ) ); 440 if ( $_nav_menu->truncated_name != $_nav_menu->name ) 441 $_nav_menu->truncated_name .= '…'; 442 443 $nav_menus[$key]->truncated_name = $_nav_menu->truncated_name; 439 $nav_menus[$key]->truncated_name = wp_html_excerpt( $_nav_menu->name, 40, '…' ); 444 440 } 445 441 … … 573 569 <?php $selected = isset( $menu_locations[$_location] ) && $menu_locations[$_location] == $menu->term_id; ?> 574 570 <option <?php if ( $selected ) echo 'data-orig="true"'; ?> <?php selected( $selected ); ?> value="<?php echo $menu->term_id; ?>"> 575 <?php $truncated_name = wp_html_excerpt( $menu->name, 40 ); 576 echo $truncated_name == $menu->name ? $menu->name : trim( $truncated_name ) . '…'; ?> 571 <?php echo wp_html_excerpt( $menu->name, 40, '…' ); ?> 577 572 </option> 578 573 <?php endforeach; ?> -
trunk/wp-includes/admin-bar.php
r23512 r24214 230 230 } 231 231 232 $title = wp_html_excerpt( $blogname, 40 ); 233 if ( $title != $blogname ) 234 $title = trim( $title ) . '…'; 232 $title = wp_html_excerpt( $blogname, 40, '…' ); 235 233 236 234 $wp_admin_bar->add_menu( array( -
trunk/wp-includes/class-wp-customize-manager.php
r23591 r24214 898 898 $choices = array( 0 => __( '— Select —' ) ); 899 899 foreach ( $menus as $menu ) { 900 $truncated_name = wp_html_excerpt( $menu->name, 40 ); 901 $truncated_name = ( $truncated_name == $menu->name ) ? $menu->name : trim( $truncated_name ) . '…'; 902 $choices[ $menu->term_id ] = $truncated_name; 900 $choices[ $menu->term_id ] = wp_html_excerpt( $menu->name, 40, '…' ); 903 901 } 904 902 -
trunk/wp-includes/comment.php
r24207 r24214 1754 1754 $excerpt = apply_filters('the_excerpt', $post->post_excerpt); 1755 1755 $excerpt = str_replace(']]>', ']]>', $excerpt); 1756 $excerpt = wp_html_excerpt($excerpt, 252 ) . '…';1756 $excerpt = wp_html_excerpt($excerpt, 252, '…'); 1757 1757 1758 1758 $post_title = apply_filters('the_title', $post->post_title, $post->ID); -
trunk/wp-includes/formatting.php
r24207 r24214 2200 2200 * @param string $text Text to trim. 2201 2201 * @param int $num_words Number of words. Default 55. 2202 * @param string $more What to append if $text needs to be trimmed. Default '…'.2202 * @param string $more Optional. What to append if $text needs to be trimmed. Default '…'. 2203 2203 * @return string Trimmed text. 2204 2204 */ … … 3119 3119 * @param integer $str String to get the excerpt from. 3120 3120 * @param integer $count Maximum number of characters to take. 3121 * @param string $more Optional. What to append if $str needs to be trimmed. Defaults to empty string. 3121 3122 * @return string The excerpt. 3122 3123 */ 3123 function wp_html_excerpt( $str, $count ) { 3124 function wp_html_excerpt( $str, $count, $more = null ) { 3125 if ( null === $more ) 3126 $more = ''; 3124 3127 $str = wp_strip_all_tags( $str, true ); 3125 $ str= mb_substr( $str, 0, $count );3128 $excerpt = mb_substr( $str, 0, $count ); 3126 3129 // remove part of an entity at the end 3127 $str = preg_replace( '/&[^;\s]{0,6}$/', '', $str ); 3128 return $str; 3130 $excerpt = preg_replace( '/&[^;\s]{0,6}$/', '', $excerpt ); 3131 if ( $str != $excerpt ) 3132 $excerpt = trim( $excerpt ) . $more; 3133 return $excerpt; 3129 3134 } 3130 3135 -
trunk/wp-trackback.php
r24207 r24214 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, '…' ); 91 $excerpt = wp_html_excerpt( $excerpt, 252, '…' ); 92 92 93 93 $comment_post_ID = (int) $tb_id;
Note: See TracChangeset
for help on using the changeset viewer.