Opened 13 years ago
Closed 13 years ago
#24292 closed defect (bug) (fixed)
Use wp_trim_words() in Recent Drafts widget
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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 ) ? '…' : '' ) . '</p>';
Introduced in [9536]. We should just use wp_trim_words() instead.
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
In 24212: