Changeset 8682 for trunk/wp-admin/edit.php
- Timestamp:
- 08/20/2008 04:06:36 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit.php
r8656 r8682 10 10 require_once('admin.php'); 11 11 12 // Handle bulk deletes 13 if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) { 14 check_admin_referer('bulk-posts'); 15 foreach( (array) $_GET['delete'] as $post_id_del ) { 16 $post_del = & get_post($post_id_del); 17 18 if ( !current_user_can('delete_post', $post_id_del) ) 19 wp_die( __('You are not allowed to delete this post.') ); 20 21 if ( $post_del->post_type == 'attachment' ) { 22 if ( ! wp_delete_attachment($post_id_del) ) 23 wp_die( __('Error in deleting...') ); 24 } else { 25 if ( !wp_delete_post($post_id_del) ) 26 wp_die( __('Error in deleting...') ); 27 } 12 // Handle bulk actions 13 if ( isset($_GET['action']) && $_GET['action'] != 'Actions' ) { 14 switch ( $_GET['action'] ) { 15 case 'delete': 16 if ( isset($_GET['post']) ) { 17 check_admin_referer('bulk-posts'); 18 foreach( (array) $_GET['post'] as $post_id_del ) { 19 $post_del = & get_post($post_id_del); 20 21 if ( !current_user_can('delete_post', $post_id_del) ) 22 wp_die( __('You are not allowed to delete this post.') ); 23 24 if ( $post_del->post_type == 'attachment' ) { 25 if ( ! wp_delete_attachment($post_id_del) ) 26 wp_die( __('Error in deleting...') ); 27 } else { 28 if ( !wp_delete_post($post_id_del) ) 29 wp_die( __('Error in deleting...') ); 30 } 31 } 32 } 33 break; 34 case 'edit': 35 // TODO: Decide what to do here - add bulk edit feature, or just disallow if >1 post selected 36 break; 28 37 } 29 30 38 $sendback = wp_get_referer(); 31 39 if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('post-new.php'); … … 53 61 $_GET['paged'] = 1; 54 62 63 if ( empty($_GET['mode']) ) 64 $mode = 'list'; 65 else 66 $mode = attribute_escape($_GET['mode']); 55 67 ?> 56 68 … … 62 74 printf(__('Comments on %s'), apply_filters( "the_title", $post->post_title)); 63 75 } else { 64 $post_status_label = _c(' ManagePosts|manage posts header');76 $post_status_label = _c('Posts|manage posts header'); 65 77 if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) 66 78 $post_status_label = $post_stati[$_GET['post_status']][1]; … … 84 96 $h2_tag = isset($_GET['tag']) && $_GET['tag'] ? ' ' . sprintf( __('tagged with “%s”'), single_tag_title('', false) ) : ''; 85 97 $h2_month = isset($_GET['m']) && $_GET['m'] ? ' ' . sprintf( __('during %s'), single_month_title(' ', false) ) : ''; 86 printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s |You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: tagged with {s}, 6: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_tag, $h2_month);98 printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s (<a href="%7$s">Add New</a>)|You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: tagged with {s}, 6: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_tag, $h2_month, 'post-new.php' ); 87 99 } 88 100 ?></h2> … … 130 142 </p> 131 143 144 <input type="hidden" name="mode" value="<?php echo $mode; ?>" /> 145 146 <ul class="view-switch"> 147 <li <?php if ( 'list' == $mode ) echo "class='current'" ?>><a href="<?php echo clean_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?>"><?php _e('List View') ?></a></li> 148 <li <?php if ( 'excerpt' == $mode ) echo "class='current'" ?>><a href="<?php echo clean_url(add_query_arg('mode', 'excerpt', $_SERVER['REQUEST_URI'])) ?>"><?php _e('Excerpt View') ?></a></li> 149 </ul> 150 132 151 <div class="tablenav"> 133 152 … … 145 164 146 165 <div class="alignleft"> 147 <input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" /> 166 <select name="action"> 167 <option value="" selected><?php _e('Actions'); ?></option> 168 <option value="delete"><?php _e('Delete'); ?></option> 169 <option value="edit"><?php _e('Edit'); ?></option> 170 </select> 171 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" class="button-secondary action" /> 148 172 <?php wp_nonce_field('bulk-posts'); ?> 149 173 <?php … … 231 255 <tr> 232 256 <th scope="col"><?php _e('Comment') ?></th> 233 <th scope="col"><?php _e('Date') ?></th> 234 <th scope="col"><?php _e('Actions') ?></th> 257 <th scope="col"><?php _e('Submitted') ?></th> 235 258 </tr> 236 259 </thead> … … 238 261 <?php 239 262 foreach ($comments as $comment) 240 _wp_comment_row( $comment->comment_ID, ' detail', false, false );263 _wp_comment_row( $comment->comment_ID, 'single', false, false ); 241 264 ?> 242 265 </tbody>
Note: See TracChangeset
for help on using the changeset viewer.