';
if ( count( $drafts ) > 3 ) {
echo '
' . __( 'View all drafts' ) . "
\n";
}
echo '
' . __( 'Your Recent 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 = "
' . get_comment_author_link( $comment ) . '', $comment_post_link, '' . __( '[Pending]' ) . '' ); } else { printf( /* translators: 1: comment author, 2: notification if the comment is pending */ __( 'From %1$s %2$s' ), '' . get_comment_author_link( $comment ) . '', '' . __( '[Pending]' ) . '' ); } ?>
comment_type ) { case 'pingback': $type = __( 'Pingback' ); break; case 'trackback': $type = __( 'Trackback' ); break; default: $type = ucwords( $comment->comment_type ); } $type = esc_html( $type ); ?>$type", $comment_post_link, '' . __( '[Pending]' ) . '' ); } else { printf( /* translators: 1: type of comment, 2: notification if the comment is pending */ _x( '%1$s %2$s', 'dashboard' ), "$type", '' . __( '[Pending]' ) . '' ); } ?>
' . __( 'No activity yet!' ) . '
'; echo '