Opened 13 years ago
Closed 13 years ago
#24292 closed defect (bug) (fixed)
Use wp_trim_words() in Recent Drafts widget
| Reported by: | SergeyBiryukov | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.6 |
| Component: | Administration | Version: | 2.7 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 24212: