Make WordPress Core


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

More custom taxonomy support for edit-tags.php

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.