WordPress.org

Make WordPress Core

Changeset 10555


Ignore:
Timestamp:
02/12/2009 12:00:01 AM (11 years ago)
Author:
ryan
Message:

More custom taxonomy support for edit-tags.php

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r10501 r10555  
    213213        die('-1');
    214214
    215     $tag = get_term( $id, 'post_tag' );
     215    if ( !empty($_POST['taxonomy']) )
     216        $taxonomy = $_POST['taxonomy'];
     217    else
     218        $taxonomy = 'post_tag';
     219
     220    $tag = get_term( $id, $taxonomy );
    216221    if ( !$tag || is_wp_error( $tag ) )
    217222        die('1');
    218223
    219     if ( wp_delete_term($id, 'post_tag'))
     224    if ( wp_delete_term($id, $taxonomy))
    220225        die('1');
    221226    else
     
    512517    }
    513518
    514     $tag = wp_insert_term($_POST['name'], 'post_tag', $_POST );
     519    if ( !empty($_POST['taxonomy']) )
     520        $taxonomy = $_POST['taxonomy'];
     521    else
     522        $taxonomy = 'post_tag';
     523
     524    $tag = wp_insert_term($_POST['name'], $taxonomy, $_POST );
    515525
    516526    if ( is_wp_error($tag) ) {
     
    522532    }
    523533
    524     if ( !$tag || (!$tag = get_term( $tag['term_id'], 'post_tag' )) )
     534    if ( !$tag || (!$tag = get_term( $tag['term_id'], $taxonomy )) )
    525535        die('0');
    526536
  • trunk/wp-admin/edit-tags.php

    r10554 r10555  
    158158<div class="col-wrap">
    159159<form id="posts-filter" action="" method="get">
     160<input type="hidden" name="taxonomy" value="<?php echo attribute_escape($taxonomy); ?>" />
    160161<div class="tablenav">
    161162<?php
     
    259260<form name="addtag" id="addtag" method="post" action="edit-tags.php" class="add:the-list: validate">
    260261<input type="hidden" name="action" value="addtag" />
     262<input type="hidden" name="taxonomy" value="<?php echo attribute_escape($taxonomy); ?>" />
    261263<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('add-tag'); ?>
    262264
Note: See TracChangeset for help on using the changeset viewer.