diff --git a/wp-admin/edit-link-categories.php b/wp-admin/edit-link-categories.php
index 371d8fd22c..f435cfaa41 100644
--- a/wp-admin/edit-link-categories.php
+++ b/wp-admin/edit-link-categories.php
@@ -181,7 +181,7 @@ if ( $page_links )
+ $category = (object) array(); $category->parent = 0; do_action('add_link_category_form_pre', $category); ?>
diff --git a/wp-admin/includes/taxonomy.php b/wp-admin/includes/taxonomy.php
index 667ff04427..a6c753d48b 100644
--- a/wp-admin/includes/taxonomy.php
+++ b/wp-admin/includes/taxonomy.php
@@ -109,7 +109,7 @@ function wp_delete_category($cat_ID) {
*/
function wp_insert_category($catarr, $wp_error = false) {
$cat_defaults = array('cat_ID' => 0, 'cat_name' => '', 'category_description' => '', 'category_nicename' => '', 'category_parent' => '');
- $cat_arr = wp_parse_args($cat_arr, $cat_defaults);
+ $catarr = wp_parse_args($catarr, $cat_defaults);
extract($catarr, EXTR_SKIP);
if ( trim( $cat_name ) == '' ) {
@@ -167,7 +167,7 @@ function wp_insert_category($catarr, $wp_error = false) {
function wp_update_category($catarr) {
$cat_ID = (int) $catarr['cat_ID'];
- if ( $cat_ID == $catarr['category_parent'] )
+ if ( isset($catarr['category_parent']) && ($cat_ID == $catarr['category_parent']) )
return false;
// First, get all of the original fields
diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
index 991224799a..13b759d881 100644
--- a/wp-includes/taxonomy.php
+++ b/wp-includes/taxonomy.php
@@ -327,9 +327,11 @@ function &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') {
if ( $output == OBJECT ) {
return $_term;
} elseif ( $output == ARRAY_A ) {
- return get_object_vars($_term);
+ $__term = get_object_vars($_term);
+ return $__term;
} elseif ( $output == ARRAY_N ) {
- return array_values(get_object_vars($_term));
+ $__term = array_values(get_object_vars($_term));
+ return $__term;
} else {
return $_term;
}