Changeset 8140
- Timestamp:
- 06/20/2008 04:58:40 PM (17 years ago)
- Location:
- branches/crazyhorse/wp-admin
- Files:
-
- 2 edited
-
edit-post-rows.php (modified) (1 diff)
-
edit.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/crazyhorse/wp-admin/edit-post-rows.php
r8130 r8140 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; -
branches/crazyhorse/wp-admin/edit.php
r8129 r8140 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); 9 10 if ( !current_user_can('delete_post', $post_id_del) ) 11 wp_die( __('You are not allowed to delete this post.') ); 12 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 } 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); 12 13 if ( !current_user_can('delete_post', $post_id_del) ) 14 wp_die( __('You are not allowed to delete this post.') ); 15 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'); … … 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
Note: See TracChangeset
for help on using the changeset viewer.