WordPress.org

Make WordPress Core

#24292 closed defect (bug) (fixed)

Use wp_trim_words() in Recent Drafts widget

Reported by: SergeyBiryukov Owned by: SergeyBiryukov
Milestone: 3.6 Priority: normal
Severity: normal Version: 2.7
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

This construct is used in Recent Drafts dashboard widget to display first 10 words of a post:

if ( $the_content = preg_split( '#[\r\n\t ]#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) )
	$item .= '<p>' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '&hellip;' : '' ) . '</p>';

Introduced in [9536]. We should just use wp_trim_words() instead.

Attachments (1)

24292.patch (995 bytes) - added by SergeyBiryukov 11 months ago.

Download all attachments as: .zip

Change History (2)

SergeyBiryukov11 months ago

comment:1 SergeyBiryukov11 months ago

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

In 24212:

Use wp_trim_words() in Recent Drafts widget. fixes #24292.

Note: See TracTickets for help on using tickets.