X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/11be8dc178e77d0b46189bbd8e33a216a9b90942..3f5685912e89eb3b0534acd85aa0946b1ca2bbe3:/wp-admin/edit-link-categories.php?ds=inline diff --git a/wp-admin/edit-link-categories.php b/wp-admin/edit-link-categories.php index 3636635c..90dcce66 100644 --- a/wp-admin/edit-link-categories.php +++ b/wp-admin/edit-link-categories.php @@ -18,13 +18,14 @@ if ( isset($_GET['action']) && isset($_GET['delete']) ) { wp_die(__('Cheatin’ uh?')); if ( 'delete' == $doaction ) { - foreach( (array) $_GET['delete'] as $cat_ID ) { - $cat_name = get_term_field('name', $cat_ID, 'link_category'); - $default_cat_id = get_option('default_link_category'); + $cats = (array) $_GET['delete']; + $default_cat_id = get_option('default_link_category'); + foreach( $cats as $cat_ID ) { + $cat_ID = (int) $cat_ID; // Don't delete the default cats. if ( $cat_ID == $default_cat_id ) - wp_die(sprintf(__("Can’t delete the %s category: this is the default one"), $cat_name)); + wp_die( sprintf( __("Can’t delete the %s category: this is the default one"), get_term_field('name', $cat_ID, 'link_category') ) ); wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); } @@ -61,9 +62,9 @@ $messages[6] = __('Categories deleted.'); ?>