WC_CSV_Exporter::send_headers()publicWC 3.1.0

Set the export headers.

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

Хуков нет.

Возвращает

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

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

$WC_CSV_Exporter = new WC_CSV_Exporter();
$WC_CSV_Exporter->send_headers();

Список изменений

С версии 3.1.0 Введена.

Код WC_CSV_Exporter::send_headers() WC 8.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' );
}