## php – Hi need update in my terms for other taxonomy

Question

I’m new to wordpress, and in this case I created 2 taxonomies, cat_notice and trash_notice, what I need to do is when I delete a term, instead of it being deleted, it is reinserted in another taxonomy or is inserted as a child of a term trash_bin.

function trashbin_pre_delete_term( $term_id,$taxonomy_name ) {
if ( $taxonomy_name === 'trash_notice' ) {$objects = get_objects_in_term( $term_id,$taxonomy );

wp_update_term( \$term_id, 'trash_notice');
}
}