Ticket #11456: t11456-excerpt-more-tweak.diff
| File t11456-excerpt-more-tweak.diff, 1.4 KB (added by , 16 years ago) |
|---|
-
wp-includes/formatting.php
1788 1788 * Generates an excerpt from the content, if needed. 1789 1789 * 1790 1790 * The excerpt word amount will be 55 words and if the amount is greater than 1791 * that, then the string ' [...]' will be appended to the excerpt. If the string1791 * that, then the string ' [...]' will be appended to the excerpt. If the string 1792 1792 * is less than 55 words, then the content will be returned as is. 1793 1793 * 1794 1794 * The 55 word limit can be modified by plugins/themes using the excerpt_length filter 1795 * The ' [..]' string can be modified by plugins/themes using the excerpt_more filter1795 * The ' [...]' string can be modified by plugins/themes using the excerpt_more filter 1796 1796 * 1797 1797 * @since 1.5.0 1798 1798 * … … 1810 1810 $text = str_replace(']]>', ']]>', $text); 1811 1811 $text = strip_tags($text); 1812 1812 $excerpt_length = apply_filters('excerpt_length', 55); 1813 $excerpt_more = apply_filters('excerpt_more', ' [...]');1813 $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]'); 1814 1814 $words = explode(' ', $text, $excerpt_length + 1); 1815 1815 if (count($words) > $excerpt_length) { 1816 1816 array_pop($words); 1817 array_push($words, $excerpt_more);1818 1817 $text = implode(' ', $words); 1818 $text = $text . $excerpt_more; 1819 1819 } 1820 1820 } 1821 1821 return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);