Changeset 6849
- Timestamp:
- 02/14/2008 09:34:19 AM (17 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-link-categories.php
r6805 r6849 1 1 <?php 2 2 require_once('admin.php'); 3 4 // Handle bulk deletes 5 if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) { 6 check_admin_referer('bulk-link-categories'); 7 8 if ( !current_user_can('manage_categories') ) 9 wp_die(__('Cheatin’ uh?')); 10 11 foreach( (array) $_GET['delete'] as $cat_ID ) { 12 $cat_name = get_term_field('name', $cat_ID, 'link_category'); 13 14 // Don't delete the default cats. 15 if ( $cat_ID == get_option('default_link_category') ) 16 wp_die(sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name)); 17 18 wp_delete_term($cat_ID, 'link_category'); 19 } 20 21 wp_redirect('edit-link-categories.php?message=6'); 22 exit(); 23 } 3 24 4 25 $title = __('Link Categories'); … … 6 27 7 28 wp_enqueue_script( 'admin-categories' ); 29 wp_enqueue_script('admin-forms'); 30 8 31 require_once ('admin-header.php'); 9 32 … … 13 36 $messages[4] = __('Category not added.'); 14 37 $messages[5] = __('Category not updated.'); 38 $messages[6] = __('Categories deleted.'); 15 39 16 40 if (isset($_GET['message'])) : ?> … … 56 80 57 81 <div style="float: left"> 58 <input type="button" value="<?php _e('Delete'); ?>" name="deleteit" /> 82 <input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" /> 83 <?php wp_nonce_field('bulk-link-categories'); ?> 59 84 </div> 60 85 61 86 <br style="clear:both;" /> 62 87 </div> 63 </form>64 88 65 89 <br style="clear:both;" /> … … 68 92 <thead> 69 93 <tr> 70 <th scope="col" style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById(' deletetags'));" /></th>94 <th scope="col" style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById('posts-filter'));" /></th> 71 95 <th scope="col"><?php _e('Name') ?></th> 72 96 <th scope="col"><?php _e('Description') ?></th> … … 96 120 </tbody> 97 121 </table> 122 </form> 98 123 99 124 <br style="clear:both;" /> -
trunk/wp-admin/includes/template.php
r6827 r6849 82 82 $count = ( $category->count > 0 ) ? "<a href='link-manager.php?cat_id=$category->term_id'>$category->count</a>" : $category->count; 83 83 $output = "<tr id='link-cat-$category->term_id'$class>" . 84 '<td style="text-align: center"> <input type="checkbox" name="delete _tags[]" value="' . $category->term_id . '" /></td>' .84 '<td style="text-align: center"> <input type="checkbox" name="delete[]" value="' . $category->term_id . '" /></td>' . 85 85 "<td>$edit</td> 86 86 <td>$category->description</td>
Note: See TracChangeset
for help on using the changeset viewer.