Ticket #4286: 4286.diff
| File 4286.diff, 4.7 KB (added by rob1n, 6 years ago) |
|---|
-
wp-admin/post-new.php
24 24 <div id="message" class="updated fade"><p><strong><?php _e('Post saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post'); ?> »</a></p></div> 25 25 <?php 26 26 endif; 27 28 if ( $drafts = get_users_drafts( $user_ID ) ) { ?> 29 <div class="wrap"> 30 <p><strong><?php _e('Your Drafts:') ?></strong> 31 <?php 32 // Show drafts. 33 $num_drafts = count($drafts); 34 if ( $num_drafts > 15 ) $num_drafts = 15; 35 for ( $i = 0; $i < $num_drafts; $i++ ) { 36 $draft = $drafts[$i]; 37 if ( 0 != $i ) 38 echo ', '; 39 if ( empty($draft->post_title) ) 40 $draft->post_title = sprintf(__('Post # %s'), $draft->ID); 41 echo "<a href='post.php?action=edit&post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>"; 27 ?> 28 29 <?php 30 31 $drafts = get_users_drafts( $user_ID ); 32 33 if ( !empty( $drafts ) ) { 34 $num_drafts = count( $drafts ); 35 36 echo '<div class="wrap">'; 37 38 if ( $num_drafts < 3 ) { 39 echo '<p><strong>' . __( 'Your Drafts:' ) . '</strong> '; 40 41 $i = 0; 42 43 foreach ( $drafts as $post ) { 44 if ( $i++ != 0 ) { 45 echo ', '; 46 } 47 48 echo '<a href="post.php?action=edit&post=' . $post->ID . '">'; 49 the_title(); 50 echo '</a>'; 51 } 52 53 echo '.</p>'; 54 } else { 55 printf( 56 '<p>' . __( 'You currently have <a href="%s">%d drafts</a>.' ) . '</p>', 57 'drafts.php', $num_drafts 58 ); 59 } 60 61 echo "</div>\n"; 42 62 } 63 64 ?> 43 65 44 if ( 15 < count($drafts) ) { ?>45 , <a href="edit.php"><?php echo sprintf(__('and %s more'), (count($drafts) - 15) ); ?> »</a>46 <?php } ?>47 .</p>48 </div>49 66 <?php 50 }51 52 67 // Show post form. 53 68 $post = get_default_post_to_edit(); 54 69 include('edit-form-advanced.php'); -
wp-admin/drafts.php
1 <?php 2 3 require_once './admin.php'; 4 5 $parent_file = 'edit.php'; 6 $submenu_file = 'drafts.php'; 7 8 if ( !current_user_can( 'edit_posts' ) ) { 9 wp_die( __( 'Sorry, but you don’t have the capability to create and edit posts.' ) ); 10 } 11 12 wp_enqueue_script( 'listman' ); 13 14 require_once './admin-header.php'; 15 16 $drafts = get_users_drafts( $user_ID ); 17 18 if ( empty( $drafts ) ) { 19 ?> 20 <div class="wrap"> 21 <p><?php _e( 'You currently do not have any drafts.' ); ?></p> 22 </div> 23 <?php 24 include_once './admin-footer.php'; 25 exit; 26 } 27 28 ?> 29 <div class="wrap"> 30 <h2><?php _e( 'Your Drafts' ); ?></h2> 31 32 <table class="widefat"> 33 <thead><tr> 34 <th scope="col" style="text-align:center"><?php _e( 'ID' ); ?></th> 35 <th scope="col"><?php _e( 'Title' ); ?></th> 36 <th scope="col"><?php _e( 'Categories' ); ?></th> 37 <th scope="col"></th> 38 <th scope="col"></th> 39 <th scope="col"></th> 40 </tr></thead> 41 42 <?php foreach ( $drafts as $post ) { ?> 43 <tr> 44 <td style="text-align:center"><?php echo $post->ID; ?></td> 45 <td><?php the_title(); ?></td> 46 <td><?php the_category( ', ' ); ?></td> 47 <td><a href="<?php echo clean_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ); ?>" class="edit" target="_blank"><?php _e( 'Preview' ); ?></a></td> 48 <td><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><a href="<?php bloginfo( 'wpurl' ); ?>/wp-admin/post.php?action=edit&post=<?php echo $post->ID; ?>" class="edit"><?php _e( 'Edit' ); ?></a><?php } ?></td> 49 <td><?php if ( current_user_can( 'delete_post', $post->ID ) ) { ?><a href="<?php echo wp_nonce_url( 'post.php?action=delete&post=' . $post->ID, 'delete-post_' . $post->ID ); ?>" class="delete" onclick="return deleteSomething( 'post', <?php echo $post->ID; ?>, '<?php echo js_escape( sprintf( __( "You are about to delete this post '%s'.\n'OK' to delete, 'Cancel' to stop." ), get_the_title() ) ); ?>' );"><?php _e( 'Delete' ); ?></a><?php } ?></td> 50 </tr> 51 <?php } ?> 52 </table> 53 </div> 54 <?php include_once './admin-footer.php'; ?> 55 No newline at end of file -
wp-admin/menu.php
36 36 37 37 38 38 $submenu['edit.php'][5] = array(__('Posts'), 'edit_posts', 'edit.php'); 39 $submenu['edit.php'][7] = array( __( 'Drafts' ), 'edit_posts', 'drafts.php' ); 39 40 $submenu['edit.php'][10] = array(__('Pages'), 'edit_pages', 'edit-pages.php'); 40 41 $submenu['edit.php'][12] = array(__('Uploads'), 'upload_files', 'upload.php'); 41 42 $submenu['edit.php'][15] = array(__('Categories'), 'manage_categories', 'categories.php');
