Trash Bin for Categories?

i finded solution for this:

add_filter( "cat_notice_row_actions", 'trash_row_actions', 10, 2 );
function trash_row_actions( $actions, $user_object ) {
    // Remove the Edit action.
    unset( $actions['delete'] );

    $catTrash = 10;
    $id = $user_object->term_id;
    $taxName = $user_object->taxonomy;
    $taxParent = $user_object->parent;
    
    // Add your custom action.

    $actions['update-parent'] = "<form action='#' method='get'>
            <input type="hidden" name="taxonomy" value="$taxName">
            <input type="hidden" name="post_type" value="noticia">
            <input type="hidden" name="termID" value="$id">
            <input type="hidden" name="trashID" value="$catTrash">
            <input type="submit" value="Excluir" onclick='add_trash_bin()'>
        </form>";
}

and after called my function:

add_action( 'admin_init', 'add_trash_bin' );
function add_trash_bin() {
    global $wpdb;
    $table_name = $wpdb->prefix . 'term_taxonomy';
    $id = isset($_GET['termID']) ? $_GET['termID'] : NULL;
    $taxName = isset($_GET['taxonomy']) ? $_GET['taxonomy'] : NULL;
    $trashID = isset($_GET['trashID']) ? $_GET['trashID'] : NULL;
    if($id <> NULL && $taxName <> NULL && $trashID <> NULL)
    {
        $wpdb->update(
            $table_name,
            array(
                'parent' => $trashID
            ), array(
                'term_id' => $id
            )
        );
        clean_taxonomy_cache( $taxName );
    } else {
        echo 'Dados incorretos';
    } }

So, i know missing error handling but its working.