Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( $_POST['delete'] ) {
- $term = get_term_by('term_id', $_POST['term_id'], $_GET['taxonomy']);
- wp_delete_term( $term->term_id, $_GET['taxonomy']);
- $term = null;
- $_GET['VIEW'] = 'tag_editor';
- }
- else {
- $term = get_term_by('term_id', $_POST['term_id'], $_GET['taxonomy']);
- wp_update_term( $term->term_id, $_GET['taxonomy'], array('name' => $_POST['name'], 'slug' => $_POST['slug']));
- $term = get_term_by('slug', $_REQUEST['slug'], $_GET['taxonomy']);
- }
- } else {
- if ( $_POST['name'] ) {
- $term = wp_insert_term($_POST['name'], $_GET['taxonomy']);
- $term = get_term($term['term_id'], $_GET['taxonomy']);
- }
Add Comment
Please, Sign In to add comment