Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#17492 closed defect (bug) (fixed)

$text param in wp_trim_excerpt should be optional

Reported by: batmoo's profile batmoo Owned by: markjaquith's profile markjaquith
Milestone: 3.3 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:


According to the Docs, the $text param is required but "if set to empty an excerpt is generated."

Calling wp_trim_excerpt(); (i.e. without the param) works, but throws a Warning.

It makes sense to default the $text param to empty and make it optional.

Attachments (2)

patch.diff (448 bytes) - added by wiltave 13 years ago.
17492.patch (608 bytes) - added by SergeyBiryukov 13 years ago.

Download all attachments as: .zip

Change History (6)

#1 @nacin
13 years ago

Patch it up, sounds fine. Don't forget the phpdoc.

13 years ago

#2 @kawauso
13 years ago

  • Keywords has-patch added

#3 @SergeyBiryukov
13 years ago

  • Milestone changed from Awaiting Review to 3.3

Updated the patch to reflect the change in PHPDocs.

#4 @markjaquith
13 years ago

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

In [18824]:

Allow the text parameter in wp_trim_excerpt() to be omitted altogether, instead of requiring a blank string. props SergeyBiryukov. fixes #17492

Note: See TracTickets for help on using tickets.