From a21af7c29fe4c986b11e22aa96ec6188e2ad3676 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 8 May 2013 23:06:41 +0000 Subject: [PATCH] Use wp_trim_words() in Recent Drafts widget. fixes #24292. git-svn-id: https://develop.svn.wordpress.org/trunk@24212 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/dashboard.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index cc72c994d4..43c3788a1c 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -589,8 +589,8 @@ function wp_dashboard_recent_drafts( $drafts = false ) { $url = get_edit_post_link( $draft->ID ); $title = _draft_or_post_title( $draft->ID ); $item = "

" . esc_html($title) . " " . get_the_time( get_option( 'date_format' ), $draft ) . '

'; - if ( $the_content = preg_split( '#[\r\n\t ]#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) ) - $item .= '

' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '…' : '' ) . '

'; + if ( $the_content = wp_trim_words( $draft->post_content, 10 ) ) + $item .= '

' . $the_content . '

'; $list[] = $item; } ?>