Ticket #7160: 7160.r8139.diff
| File 7160.r8139.diff, 3.0 KB (added by , 18 years ago) |
|---|
-
wp-admin/edit-post-rows.php
48 48 49 49 case 'cb': 50 50 ?> 51 <th scope="row" class="check-column"><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><input type="checkbox" name=" delete[]" value="<?php the_ID(); ?>" /><?php } ?></th>51 <th scope="row" class="check-column"><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /><?php } ?></th> 52 52 <?php 53 53 break; 54 54 case 'modified': -
wp-admin/edit.php
1 1 <?php 2 2 require_once('admin.php'); 3 3 4 // Handle bulk deletes 5 if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) { 6 check_admin_referer('bulk-posts'); 7 foreach( (array) $_GET['delete'] as $post_id_del ) { 8 $post_del = & get_post($post_id_del); 4 // Handle bulk actions 5 if ( isset($_GET['action']) && $_GET['action'] != 'Actions' ) { 6 switch ( $_GET['action'] ) { 7 case 'delete': 8 if ( isset($_GET['post']) ) { 9 check_admin_referer('bulk-posts'); 10 foreach( (array) $_GET['post'] as $post_id_del ) { 11 $post_del = & get_post($post_id_del); 9 12 10 if ( !current_user_can('delete_post', $post_id_del) )11 wp_die( __('You are not allowed to delete this post.') );13 if ( !current_user_can('delete_post', $post_id_del) ) 14 wp_die( __('You are not allowed to delete this post.') ); 12 15 13 if ( $post_del->post_type == 'attachment' ) { 14 if ( ! wp_delete_attachment($post_id_del) ) 15 wp_die( __('Error in deleting...') ); 16 } else { 17 if ( !wp_delete_post($post_id_del) ) 18 wp_die( __('Error in deleting...') ); 19 } 16 if ( $post_del->post_type == 'attachment' ) { 17 if ( ! wp_delete_attachment($post_id_del) ) 18 wp_die( __('Error in deleting...') ); 19 } else { 20 if ( !wp_delete_post($post_id_del) ) 21 wp_die( __('Error in deleting...') ); 22 } 23 } 24 } 25 break; 26 case 'edit': 27 // TODO: Decide what to do here - add bulk edit feature, or just disallow if >1 post selected 28 break; 20 29 } 21 22 30 $sendback = wp_get_referer(); 23 31 if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('post-new.php'); 24 32 elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); … … 151 159 ?> 152 160 153 161 <div class="alignleft"> 154 <input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" /> 162 <select name="action"> 163 <option value="" selected><?php _e('Actions'); ?></option> 164 <option value="delete"><?php _e('Delete'); ?></option> 165 <option value="edit"><?php _e('Edit'); ?></option> 166 </select> 167 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" class="button-secondary action" /> 155 168 <?php wp_nonce_field('bulk-posts'); ?> 156 169 <?php 157 170 if ( !is_singular() ) {