Make WordPress Core

Changeset 6759


Ignore:
Timestamp:
02/08/2008 07:38:53 PM (17 years ago)
Author:
ryan
Message:

Bulk tag delete from jhodgdon. see #5684

File:
1 edited

Legend:

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

    r6727 r6759  
    3535
    3636    wp_redirect('edit-tags.php?message=2');
     37    exit;
     38
     39break;
     40
     41case 'bulk-delete':
     42    check_admin_referer('bulk-tags');
     43
     44    if ( !current_user_can('manage_categories') )
     45        wp_die(__('Cheatin’ uh?'));
     46
     47    $tags = $_POST['delete_tags'];
     48    foreach( $tags as $tag_ID ) {
     49      wp_delete_term( $tag_ID, 'post_tag');
     50    }
     51
     52    wp_redirect('edit-tags.php?message=6');
    3753    exit;
    3854
     
    7793$messages[4] = __('Tag not added.');
    7894$messages[5] = __('Tag not updated.');
     95$messages[6] = __('Tags deleted.');
    7996?>
    8097
     
    101118<form name="deletetags" id="deletetags" action="" method="post">
    102119<?php wp_nonce_field('bulk-tags'); ?>
     120<input type="hidden" name="action" value="bulk-delete" />
    103121<table class="widefat">
    104122    <thead>
     
    123141    </tbody>
    124142</table>
     143<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>
    125144</form>
    126145<?php
Note: See TracChangeset for help on using the changeset viewer.