WordPress at Your Fingertips
function is not described

WC_Admin_Exporters::download_export_file() public WC 1.0

Serve the generated file.

{} It's a method of the class: WC_Admin_Exporters{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Admin_Exporters = new WC_Admin_Exporters();
$WC_Admin_Exporters->download_export_file();

Code of WC_Admin_Exporters::download_export_file() WC 5.9.0

public function download_export_file() {
	if ( isset( $_GET['action'], $_GET['nonce'] ) && wp_verify_nonce( wp_unslash( $_GET['nonce'] ), 'product-csv' ) && 'download_product_csv' === wp_unslash( $_GET['action'] ) ) { // WPCS: input var ok, sanitization ok.
		include_once WC_ABSPATH . 'includes/export/class-wc-product-csv-exporter.php';
		$exporter = new WC_Product_CSV_Exporter();

		if ( ! empty( $_GET['filename'] ) ) { // WPCS: input var ok.
			$exporter->set_filename( wp_unslash( $_GET['filename'] ) ); // WPCS: input var ok, sanitization ok.
		}

		$exporter->export();
	}
}