Changeset 5749
- Timestamp:
- 06/24/2007 05:46:08 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/post-new.php
r5707 r5749 33 33 $others_drafts = get_others_drafts($user_ID); 34 34 35 $nag_posts_limit = (int) apply_filters('nag_posts_limit', 3); 36 37 $nag_posts = array( 38 array( 39 'my_drafts', 40 __('Your Drafts:'), 41 'edit.php?post_status=draft&author=' . $user_ID, 42 count($my_drafts)), 43 array( 44 'pending', 45 __('Pending Review:'), 46 'edit.php?post_status=pending', 47 count($pending)), 48 array( 49 'others_drafts', 50 __('Others’ Drafts:'), 51 'edit.php?post_status=pending&author=-' . $user_ID, 52 count($others_drafts)) 53 ); 54 35 55 if ( !empty($my_drafts) || !empty($pending) || !empty($others_drafts) ) { 36 56 echo '<div class="wrap" id="draft-nag">'; 37 57 38 if ( $my_drafts) {39 echo '<p><strong>' . __( 'Your Drafts:' ) . '</strong> ';40 if ( count($my_drafts) < 3 ) {58 foreach ( $nag_posts as $nag ) { 59 if ( ${$nag[0]} ) { 60 echo '<p><strong>' . wp_specialchars($nag[1]) . '</strong> '; 41 61 $i = 0; 42 foreach ( $my_drafts as $post ) { 43 if ( $i++ != 0 ) 44 echo ', '; 62 foreach ( ${$nag[0]} as $post ) { 63 $i++; 64 if ( $i > $nag_posts_limit ) 65 break; 45 66 echo '<a href="post.php?action=edit&post=' . $post->ID . '">'; 46 67 the_title(); 47 68 echo '</a>'; 69 if ( $i < min($nag[3], $nag_posts_limit) ) 70 echo ', '; 48 71 } 72 if ( $nag[3] > $nag_posts_limit ) 73 printf(__(', and <a href="%s">%d more</a>'), $nag[2], $nag[3] - $nag_posts_limit); 49 74 echo '.</p>'; 50 } else {51 printf(52 __( 'You have <a href="%s">%d drafts</a>.' ) . '</p>',53 'edit.php?post_status=draft&author=' . $user_ID, count($my_drafts)54 );55 75 } 56 76 } 57 58 if ( $pending ) {59 echo '<p><strong>' . __( 'Pending Review:' ) . '</strong> ';60 if ( count($pending) < 3 ) {61 $i = 0;62 foreach ( $pending as $post ) {63 if ( $i++ != 0 )64 echo ', ';65 echo '<a href="post.php?action=edit&post=' . $post->ID . '">';66 the_title();67 echo '</a>';68 }69 echo '.</p>';70 } else {71 printf(72 __( 'There are <a href="%s">%d drafts pending review</a>.' ) . '</p>',73 'edit.php?post_status=pending', count($pending)74 );75 }76 }77 78 if ( $others_drafts ) {79 echo '<p><strong>' . __( 'Others’ Drafts:' ) . '</strong> ';80 if ( count($others_drafts) < 3 ) {81 $i = 0;82 foreach ( $others_drafts as $post ) {83 if ( $i++ != 0 )84 echo ', ';85 echo '<a href="post.php?action=edit&post=' . $post->ID . '">';86 the_title();87 echo '</a>';88 }89 echo '.</p>';90 } else {91 printf(92 __( 'There are <a href="%s">%d in-progress drafts by other authors</a>.' ) . '</p>',93 'edit.php?post_status=pending&author=-' . $user_ID, count($others_drafts)94 );95 }96 }97 98 77 echo "</div>\n"; 99 78 }
Note: See TracChangeset
for help on using the changeset viewer.