-$my_drafts = get_users_drafts($user_ID);
-$pending = get_others_pending($user_ID);
-$others_drafts = get_others_drafts($user_ID);
-
-$nag_posts_limit = (int) apply_filters('nag_posts_limit', 3);
-
-$nag_posts = array(
- array(
- 'my_drafts',
- __('Your Drafts:'),
- 'edit.php?post_status=draft&author=' . $user_ID,
- count($my_drafts)),
- array(
- 'pending',
- __('Pending Review:'),
- 'edit.php?post_status=pending',
- count($pending)),
- array(
- 'others_drafts',
- __('Others’ Drafts:'),
- 'edit.php?post_status=draft&author=-' . $user_ID,
- count($others_drafts))
- );
-
-if ( !empty($my_drafts) || !empty($pending) || !empty($others_drafts) ) {
- echo '<div class="wrap" id="draft-nag">';
-
- foreach ( $nag_posts as $nag ) {
- if ( ${$nag[0]} ) {
- echo '<p><strong>' . wp_specialchars($nag[1]) . '</strong> ';
- $i = 0;
- foreach ( ${$nag[0]} as $post ) {
- $i++;
- if ( $i > $nag_posts_limit )
- break;
- echo '<a href="post.php?action=edit&post=' . $post->ID . '">';
- ( '' == the_title('', '', FALSE) ) ? printf( __('Post #%s'), $post->ID ) : the_title();
- echo '</a>';
- if ( $i < min($nag[3], $nag_posts_limit) )
- echo ', ';
- }
- if ( $nag[3] > $nag_posts_limit )
- printf(__(', and <a href="%s">%d more</a>'), $nag[2], $nag[3] - $nag_posts_limit);
- echo '.</p>';
- }
- }
- echo "</div>\n";
-}
-?>