';
if ( count( $drafts ) > 3 ) {
echo '
' . _x( 'View all', 'drafts' ) . "
\n";
}
echo '
' . __( 'Drafts' ) . "
\n
";
$drafts = array_slice( $drafts, 0, 3 );
foreach ( $drafts as $draft ) {
$url = get_edit_post_link( $draft->ID );
$title = _draft_or_post_title( $draft->ID );
echo "- \n";
/* translators: %s: post title */
echo '';
if ( $the_content = wp_trim_words( $draft->post_content, 10 ) ) {
echo '
' . $the_content . '
';
}
echo " \n";
}
echo "
\n
";
}
/**
* Outputs a row for the Recent Comments widget.
*
* @access private
* @since 2.7.0
*
* @global WP_Comment $comment
*
* @param WP_Comment $comment The current comment.
* @param bool $show_date Optional. Whether to display the date.
*/
function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
$GLOBALS['comment'] = clone $comment;
if ( $comment->comment_post_ID > 0 ) {
$comment_post_title = _draft_or_post_title( $comment->comment_post_ID );
$comment_post_url = get_the_permalink( $comment->comment_post_ID );
$comment_post_link = "