WC_CSV_Exporter::send_headers
Set the export headers.
Method of the class: WC_CSV_Exporter{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_CSV_Exporter = new WC_CSV_Exporter(); $WC_CSV_Exporter->send_headers();
Changelog
| Since 3.1.0 | Introduced. |
WC_CSV_Exporter::send_headers() WC CSV Exporter::send headers code WC 10.7.0
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' );
}