WC_Admin_Exporters::download_export_file()publicWC 1.0

Serve the generated file.

Метод класса: WC_Admin_Exporters{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

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

Код WC_Admin_Exporters::download_export_file() WC 8.7.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();
	}
}