WC_Download_Handler::check_downloads_remaining()private staticWC 1.0

Check if there are downloads remaining.

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

Хуков нет.

Возвращает

null. Ничего.

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

$result = WC_Download_Handler::check_downloads_remaining( $download );
$download(WC_Customer_Download) (обязательный)
Download instance.

Код WC_Download_Handler::check_downloads_remaining() WC 6.9.4

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