function im_check_term($name,$tax){
$term = get_term_by("\x6e\x61\x6d\x65", $name,$tax);
return !is_wp_error($term) ? $term->term_id : false;
}
function im_add_new_term($name,$tax){
if($tax == "\x67\x65\x6e\x72\x65"){
return wp_insert_term($name,$tax,array("\x73\x6c\x75\x67"=>array_search ($name, $genres)))["\x74\x65\x72\x6d\x5f\x69\x64"];
} else {
return wp_insert_term($name,$tax)["\x74\x65\x72\x6d\x5f\x69\x64"];
}
}
error Trying to get property of non-object and Cannot use object of type WP_Error as array in
与本文相关的文章
评论列表(0)
- 暂无评论