diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php
index b87844b..31a13f1 100644
|
a
|
b
|
function comment_date( $d = '', $comment_ID = 0 ) { |
| 494 | 494 | /** |
| 495 | 495 | * Retrieve the excerpt of the current comment. |
| 496 | 496 | * |
| 497 | | * Will cut each word and only output the first 20 words with '…' at the end. |
| | 497 | * Will cut each word and only output the first $excerpt_length words with '…' at the end. |
| 498 | 498 | * If the word count is less than 20, then no truncating is done and no '…' |
| 499 | 499 | * will appear. |
| 500 | 500 | * |
| … |
… |
function comment_date( $d = '', $comment_ID = 0 ) { |
| 506 | 506 | */ |
| 507 | 507 | function get_comment_excerpt( $comment_ID = 0 ) { |
| 508 | 508 | $comment = get_comment( $comment_ID ); |
| 509 | | $comment_text = strip_tags($comment->comment_content); |
| 510 | | $blah = explode(' ', $comment_text); |
| 511 | | if (count($blah) > 20) { |
| 512 | | $k = 20; |
| 513 | | $use_dotdotdot = 1; |
| | 509 | $comment_text = strip_tags( $comment->comment_content ); |
| | 510 | $words = explode( ' ', $comment_text ); |
| | 511 | $excerpt_length = apply_filters( 'comment_excerpt_length', 20 ); |
| | 512 | $excerpt = ''; |
| | 513 | |
| | 514 | if ( count( $words ) > $excerpt_length ) { |
| | 515 | $k = $excerpt_length; |
| | 516 | $use_ellipsis = 1; |
| 514 | 517 | } else { |
| 515 | | $k = count($blah); |
| 516 | | $use_dotdotdot = 0; |
| | 518 | $k = count( $words ); |
| | 519 | $use_ellipsis = 0; |
| 517 | 520 | } |
| 518 | | $excerpt = ''; |
| 519 | | for ($i=0; $i<$k; $i++) { |
| 520 | | $excerpt .= $blah[$i] . ' '; |
| | 521 | |
| | 522 | for ( $i=0; $i<$k; $i++ ) { |
| | 523 | $excerpt .= $words[ $i ] . ' '; |
| 521 | 524 | } |
| 522 | | $excerpt .= ($use_dotdotdot) ? '…' : ''; |
| | 525 | |
| | 526 | $excerpt .= ( 1 === $use_ellipsis ? '…' : '' ); |
| | 527 | |
| 523 | 528 | return apply_filters('get_comment_excerpt', $excerpt); |
| 524 | 529 | } |
| 525 | 530 | |