Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#17492 closed defect (bug) (fixed)

$text param in wp_trim_excerpt should be optional

Reported by: batmoo Owned by: 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 4 years ago.
17492.patch (608 bytes) - added by SergeyBiryukov 4 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 @nacin4 years ago

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

@wiltave4 years ago

comment:2 @kawauso4 years ago

  • Keywords has-patch added

@SergeyBiryukov4 years ago

comment:3 @SergeyBiryukov4 years ago

  • Milestone changed from Awaiting Review to 3.3

Updated the patch to reflect the change in PHPDocs.

comment:4 @markjaquith3 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.