diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php
index b87844b..f0dfe4b 100644
|
a
|
b
|
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 = ''; |
| | 512 | |
| | 513 | /** |
| | 514 | * Filter the amount of words used in the comment excerpt. |
| | 515 | * |
| | 516 | * @since 3.9 |
| | 517 | * |
| | 518 | * @param int $comment_excerpt_length The amount of words you want to display in the comment excerpt. |
| | 519 | */ |
| | 520 | $comment_excerpt_length = apply_filters( 'comment_excerpt_length', 20 ); |
| | 521 | |
| | 522 | if ( count( $words ) > $comment_excerpt_length ) { |
| | 523 | $k = $comment_excerpt_length; |
| | 524 | $use_ellipsis = 1; |
| 514 | 525 | } else { |
| 515 | | $k = count($blah); |
| 516 | | $use_dotdotdot = 0; |
| | 526 | $k = count( $words ); |
| | 527 | $use_ellipsis = 0; |
| 517 | 528 | } |
| 518 | | $excerpt = ''; |
| 519 | | for ($i=0; $i<$k; $i++) { |
| 520 | | $excerpt .= $blah[$i] . ' '; |
| | 529 | |
| | 530 | for ( $i = 0; $i < $k; $i++ ) { |
| | 531 | $excerpt .= $words[ $i ] . ' '; |
| 521 | 532 | } |
| 522 | | $excerpt .= ($use_dotdotdot) ? '…' : ''; |
| | 533 | |
| | 534 | $excerpt .= ( 1 === $use_ellipsis ? '…' : '' ); |
| | 535 | |
| 523 | 536 | return apply_filters('get_comment_excerpt', $excerpt); |
| 524 | 537 | } |
| 525 | 538 | |