WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#7778 closed enhancement (fixed)

Excerpt length enhancement

Reported by: dougal Owned by: anonymous
Priority: normal Milestone: 2.7
Component: General Version:
Severity: normal Keywords: excerpts, wp_trim_excerpt, excerpt_length
Cc: dougal

Description

I had a client who wanted a different excerpt length than the default (55 words). I quickly realized that the only way to do it currently is to copy the existing wp_trim_excerpt() function, remove the default filter, and add your custom filter.

This would be made much simpler by simply applying a filter on the $excerpt_length variable. Diff attached.

Attachments (1)

formatting.php.diff (474 bytes) - added by dougal 5 years ago.
Add a filter on $excerpt_length so that plugins can adjust it

Download all attachments as: .zip

Change History (2)

dougal5 years ago

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

comment:1 westi5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [8958]) Add a filter on $excerpt_length. Fixes #7778 props dougal.

Note: See TracTickets for help on using tickets.