Changeset 45505 for trunk/src/wp-admin/includes/dashboard.php
- Timestamp:
- 06/08/2019 06:41:08 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/dashboard.php
r45450 r45505 585 585 echo '<h2 class="hide-if-no-js">' . __( 'Your Recent Drafts' ) . "</h2>\n<ul>"; 586 586 587 /* translators: Maximum number of words used in a preview of a draft on the dashboard. */ 588 $draft_length = intval( _x( '10', 'draft_length' ) ); 589 587 590 $drafts = array_slice( $drafts, 0, 3 ); 588 591 foreach ( $drafts as $draft ) { … … 593 596 echo '<div class="draft-title"><a href="' . esc_url( $url ) . '" aria-label="' . esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ) . '">' . esc_html( $title ) . '</a>'; 594 597 echo '<time datetime="' . get_the_time( 'c', $draft ) . '">' . get_the_time( __( 'F j, Y' ), $draft ) . '</time></div>'; 595 if ( $the_content = wp_trim_words( $draft->post_content, 10) ) {598 if ( $the_content = wp_trim_words( $draft->post_content, $draft_length ) ) { 596 599 echo '<p>' . $the_content . '</p>'; 597 600 }
Note: See TracChangeset
for help on using the changeset viewer.