Make WordPress Core


Ignore:
Timestamp:
05/08/2013 11:06:41 PM (12 years ago)
Author:
SergeyBiryukov
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/dashboard.php

    r24207 r24212  
    590590            $title = _draft_or_post_title( $draft->ID );
    591591            $item = "<h4><a href='$url' title='" . sprintf( __( 'Edit &#8220;%s&#8221;' ), esc_attr( $title ) ) . "'>" . esc_html($title) . "</a> <abbr title='" . get_the_time(__('Y/m/d g:i:s A'), $draft) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';
    592             if ( $the_content = preg_split( '#[\r\n\t ]#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) )
    593                 $item .= '<p>' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '&hellip;' : '' ) . '</p>';
     592            if ( $the_content = wp_trim_words( $draft->post_content, 10 ) )
     593                $item .= '<p>' . $the_content . '</p>';
    594594            $list[] = $item;
    595595        }
Note: See TracChangeset for help on using the changeset viewer.