WC_CSV_Exporter::send_headers()
Set the export headers.
Description Description
Source Source
File: includes/export/abstract-wc-csv-exporter.php
public function send_headers() {
if ( function_exists( 'gc_enable' ) ) {
gc_enable(); // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.gc_enableFound
}
if ( function_exists( 'apache_setenv' ) ) {
@apache_setenv( 'no-gzip', 1 ); // @codingStandardsIgnoreLine
}
@ini_set( 'zlib.output_compression', 'Off' ); // @codingStandardsIgnoreLine
@ini_set( 'output_buffering', 'Off' ); // @codingStandardsIgnoreLine
@ini_set( 'output_handler', '' ); // @codingStandardsIgnoreLine
ignore_user_abort( true );
wc_set_time_limit( 0 );
wc_nocache_headers();
header( 'Content-Type: text/csv; charset=utf-8' );
header( 'Content-Disposition: attachment; filename=' . $this->get_filename() );
header( 'Pragma: no-cache' );
header( 'Expires: 0' );
}
Changelog Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |