WC_Download_Handler::check_downloads_remaining()
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() WC Download Handler::check downloads remaining code WC 9.4.2
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 ); } }