Changeset 6848

Show
Ignore:
Timestamp:
02/14/08 09:26:40 (7 months ago)
Author:
ryan
Message:

Bulk tag delete

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/edit-tags.php

    r6800 r6848  
    66 
    77wp_reset_vars(array('action', 'tag')); 
     8 
     9if ( isset($_GET['deleteit']) && isset($_GET['delete_tags']) ) 
     10    $action = 'bulk-delete'; 
    811 
    912switch($action) { 
     
    4548        wp_die(__('Cheatin’ uh?')); 
    4649 
    47     $tags = $_POST['delete_tags']; 
    48     foreach( $tags as $tag_ID ) { 
    49       wp_delete_term( $tag_ID, 'post_tag'); 
     50    $tags = $_GET['delete_tags']; 
     51    foreach( (array) $tags as $tag_ID ) { 
     52       wp_delete_term( $tag_ID, 'post_tag'); 
    5053    } 
    5154 
     
    137140 
    138141<div style="float: left"> 
    139 <input type="button" value="<?php _e('Delete'); ?>" name="deleteit" /> 
     142<input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" /> 
     143<?php wp_nonce_field('bulk-tags'); ?> 
    140144</div> 
    141145 
    142146<br style="clear:both;" /> 
    143147</div> 
    144 </form> 
    145148 
    146149<br style="clear:both;" /> 
    147150 
    148 <form name="deletetags" id="deletetags" action="" method="post"> 
    149 <?php wp_nonce_field('bulk-tags'); ?> 
    150151<input type="hidden" name="action" value="bulk-delete" /> 
    151152<table class="widefat"> 
    152153    <thead> 
    153154    <tr> 
    154         <th scope="col" style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById('deletetags'));" /></th> 
     155        <th scope="col" style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById('posts-filter'));" /></th> 
    155156        <th scope="col"><?php _e('Name') ?></th> 
    156157        <th scope="col" width="90" style="text-align: center"><?php _e('Posts') ?></th> 
     
    166167    </tbody> 
    167168</table> 
    168 <p class="submit"><input type="submit" class="button" name="deletetags" id="deletetags" value="<?php _e('Delete Checked Tags &raquo;') ?>" onclick="return confirm('<?php echo js_escape(__("You are about to delete these tags permanently.\n'Cancel' to stop, 'OK' to delete.")); ?>')" /></p> 
    169169</form> 
     170 
     171<br style="clear:both;" /> 
    170172 
    171173<div class="tablenav">