Opened 2 years ago

Closed 20 months ago

#17492 closed defect (bug) (fixed)

$text param in wp_trim_excerpt should be optional

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

Description

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 2 years ago.
17492.patch (608 bytes) - added by SergeyBiryukov 21 months ago.

Download all attachments as: .zip

Change History (6)

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

wiltave2 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.3

Updated the patch to reflect the change in PHPDocs.

  • 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.