Changeset 11907
- Timestamp:
- 09/09/2009 04:34:44 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r11848 r11907 1697 1697 * is less than 55 words, then the content will be returned as is. 1698 1698 * 1699 * The 55 word limit can be modified by plugins/themes using the excerpt_length filter 1700 * The '[..]' string can be modified by plugins/themes using the excerpt_more filter 1701 * 1699 1702 * @since 1.5.0 1700 1703 * 1701 * @param string $text The ex erpt. If set to empty an excerpt is generated.1704 * @param string $text The excerpt. If set to empty an excerpt is generated. 1702 1705 * @return string The excerpt. 1703 1706 */ … … 1713 1716 $text = strip_tags($text); 1714 1717 $excerpt_length = apply_filters('excerpt_length', 55); 1718 $excerpt_more = apply_filters('excerpt_more', '[...]'); 1715 1719 $words = explode(' ', $text, $excerpt_length + 1); 1716 1720 if (count($words) > $excerpt_length) { 1717 1721 array_pop($words); 1718 array_push($words, '[...]');1722 array_push($words, $excerpt_more); 1719 1723 $text = implode(' ', $words); 1720 1724 }
Note: See TracChangeset
for help on using the changeset viewer.