WC_Download_Handler::clean_buffers()private staticWC 1.0

Clean all output buffers.

Can prevent errors, for example: transfer closed with 3 bytes remaining to read.

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

Хуков нет.

Возвращает

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

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

$result = WC_Download_Handler::clean_buffers();

Код WC_Download_Handler::clean_buffers() WC 9.3.3

private static function clean_buffers() {
	if ( ob_get_level() ) {
		$levels = ob_get_level();
		for ( $i = 0; $i < $levels; $i++ ) {
			@ob_end_clean(); // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
		}
	} else {
		@ob_end_clean(); // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
	}
}