Warning fixes
git-svn-id: http://svn.automattic.com/wordpress/trunk@9481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f5d5354bb9
commit
0a8415ae7a
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue