Make the excerpt_more filter include the space. Props demetris. fixes #11456

git-svn-id: https://develop.svn.wordpress.org/trunk@12414 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-12-16 16:38:58 +00:00
parent 065c684cea
commit 3b656ce72e
1 changed files with 4 additions and 4 deletions

View File

@ -1788,11 +1788,11 @@ function human_time_diff( $from, $to = '' ) {
* Generates an excerpt from the content, if needed. * Generates an excerpt from the content, if needed.
* *
* The excerpt word amount will be 55 words and if the amount is greater than * The excerpt word amount will be 55 words and if the amount is greater than
* that, then the string '[...]' will be appended to the excerpt. If the string * that, then the string ' [...]' will be appended to the excerpt. If the string
* is less than 55 words, then the content will be returned as is. * is less than 55 words, then the content will be returned as is.
* *
* The 55 word limit can be modified by plugins/themes using the excerpt_length filter * The 55 word limit can be modified by plugins/themes using the excerpt_length filter
* The '[..]' string can be modified by plugins/themes using the excerpt_more filter * The ' [...]' string can be modified by plugins/themes using the excerpt_more filter
* *
* @since 1.5.0 * @since 1.5.0
* *
@ -1810,12 +1810,12 @@ function wp_trim_excerpt($text) {
$text = str_replace(']]>', ']]>', $text); $text = str_replace(']]>', ']]>', $text);
$text = strip_tags($text); $text = strip_tags($text);
$excerpt_length = apply_filters('excerpt_length', 55); $excerpt_length = apply_filters('excerpt_length', 55);
$excerpt_more = apply_filters('excerpt_more', '[...]'); $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
$words = explode(' ', $text, $excerpt_length + 1); $words = explode(' ', $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) { if (count($words) > $excerpt_length) {
array_pop($words); array_pop($words);
array_push($words, $excerpt_more);
$text = implode(' ', $words); $text = implode(' ', $words);
$text = $text . $excerpt_more;
} }
} }
return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);