Make WordPress Core

Ticket #15008: 15008.diff

File 15008.diff, 1.2 KB (added by blepoxp, 14 years ago)

if taxonomy is category, send through wp_delete_category wrapper function

  • admin-ajax.php

     
    357357        if ( !$tag || is_wp_error( $tag ) )
    358358                die('1');
    359359
    360         if ( wp_delete_term($tag_id, $taxonomy))
     360        if ( 'category' == $taxonomy && wp_delete_category( $tag_id ) )
    361361                die('1');
     362        elseif( wp_delete_term( $tag_id, $taxonomy ) )
     363                die('1');
    362364        else
    363365                die('0');
    364366        break;
  • edit-tags.php

     
    6969        if ( !current_user_can( $tax->cap->delete_terms ) )
    7070                wp_die( __( 'Cheatin’ uh?' ) );
    7171
    72         wp_delete_term( $tag_ID, $taxonomy );
     72        if ( 'category' == $taxonomy )
     73                wp_delete_category( $tag_ID );
     74        else
     75                wp_delete_term( $tag_ID, $taxonomy );
    7376
    7477        $location = add_query_arg( 'message', 2, $location );
    7578        wp_redirect( $location );
     
    8588
    8689        $tags = (array) $_REQUEST['delete_tags'];
    8790        foreach ( $tags as $tag_ID ) {
    88                 wp_delete_term( $tag_ID, $taxonomy );
     91                if ( 'category' == $taxonomy )
     92                        wp_delete_category( $tag_ID );
     93                else
     94                        wp_delete_term( $tag_ID, $taxonomy );
    8995        }
    9096
    9197        $location = 'edit-tags.php?taxonomy=' . $taxonomy;