how to save a pastebin /** * Save downloadable files. * * @param WC_Product $product Product instance. * @param array $downloads Downloads data. * * @return WC_Product */ protected function save_downloadable_files( $product, $downloads ) { $files = []; foreach ( $downloads as $key => $file ) { how to save a pastebin How to dowload it? how to save a pastebin if ( empty( $file['file'] ) ) { continue; } $download = new WC_Product_Download(); $download->set_id( $key ); $download->set_name( $file['name'] ? $file['name'] : wc_get_filename_from_url( $file['file'] ) ); $download->set_file( apply_filters( 'woocommerce_file_download_path', $file['file'], $product, $key ) ); $files[] = $download; } how to save a pastebin How to use it? how to save a pastebin $product->set_downloads( $files ); return $product; } how to save a pastebin