WordPress.org

Make WordPress Core

Ticket #7778: formatting.php.diff

File formatting.php.diff, 474 bytes (added by dougal, 6 years ago)

Add a filter on $excerpt_length so that plugins can adjust it

  • formatting.php

     
    13251325                $text = str_replace(']]>', ']]>', $text); 
    13261326                $text = strip_tags($text); 
    13271327                $excerpt_length = 55; 
     1328                $excerpt_length = apply_filters('excerpt_length', $excerpt_length); 
    13281329                $words = explode(' ', $text, $excerpt_length + 1); 
    13291330                if (count($words) > $excerpt_length) { 
    13301331                        array_pop($words);