WordPress at Your Fingertips
function is not described

WC_Download_Handler::clean_buffers() private WC 1.0

Clean all output buffers.

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

{} It's a method of the class: WC_Download_Handler{}

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Download_Handler::clean_buffers();

Code of WC_Download_Handler::clean_buffers() WC 5.6.0

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
	}
}