Make WordPress Core

Changeset 11907


Ignore:
Timestamp:
09/09/2009 04:34:44 PM (16 years ago)
Author:
westi
Message:

Give plugins and themes simple control over the text displayed at the end of an autogenerated excerpt. Fixes #10395 props ramiy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r11848 r11907  
    16971697 * is less than 55 words, then the content will be returned as is.
    16981698 *
     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 *
    16991702 * @since 1.5.0
    17001703 *
    1701  * @param string $text The exerpt. If set to empty an excerpt is generated.
     1704 * @param string $text The excerpt. If set to empty an excerpt is generated.
    17021705 * @return string The excerpt.
    17031706 */
     
    17131716        $text = strip_tags($text);
    17141717        $excerpt_length = apply_filters('excerpt_length', 55);
     1718        $excerpt_more = apply_filters('excerpt_more', '[...]');
    17151719        $words = explode(' ', $text, $excerpt_length + 1);
    17161720        if (count($words) > $excerpt_length) {
    17171721            array_pop($words);
    1718             array_push($words, '[...]');
     1722            array_push($words, $excerpt_more);
    17191723            $text = implode(' ', $words);
    17201724        }
Note: See TracChangeset for help on using the changeset viewer.