WC_Download_Handler::clean_buffers()
Clean all output buffers.
Can prevent errors, for example: transfer closed with 3 bytes remaining to read.
Method of the class: WC_Download_Handler{}
No Hooks.
Return
null
. Nothing (null).
Usage
$result = WC_Download_Handler::clean_buffers();
WC_Download_Handler::clean_buffers() WC Download Handler::clean buffers code WC 9.4.2
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 } }