Warning fixes

git-svn-id: https://develop.svn.wordpress.org/trunk@9481 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-11-02 23:52:49 +00:00
parent ab7836e072
commit 0b0632ccf1
3 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ if ( $page_links )
<div class="col-wrap">
<?php if ( current_user_can('manage_categories') ) {
do_action('add_link_category_form_pre', $category); ?>
$category = (object) array(); $category->parent = 0; do_action('add_link_category_form_pre', $category); ?>
<div class="form-wrap">
<h3><?php _e('Add Category'); ?></h3>
+2 -2
View File
@@ -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
+4 -2
View File
@@ -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;
}