WC_Download_Handler::check_downloads_remaining()private staticWC 1.0

Check if there are downloads remaining.

Method of the class: WC_Download_Handler{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = WC_Download_Handler::check_downloads_remaining( $download );
$download(WC_Customer_Download) (required)
Download instance.

WC_Download_Handler::check_downloads_remaining() code WC 9.0.1

private static function check_downloads_remaining( $download ) {
	if ( '' !== $download->get_downloads_remaining() && 0 >= $download->get_downloads_remaining() ) {
		self::download_error( __( 'Sorry, you have reached your download limit for this file', 'woocommerce' ), '', 403 );
	}
}