WC_Product::set_download_limit()publicWC 3.0.0

Set download limit.

Method of the class: WC_Product{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Product = new WC_Product();
$WC_Product->set_download_limit( $download_limit );
$download_limit(int|string) (required)
Product download limit.

Changelog

Since 3.0.0 Introduced.

WC_Product::set_download_limit() code WC 8.7.0

public function set_download_limit( $download_limit ) {
	$this->set_prop( 'download_limit', -1 === (int) $download_limit || '' === $download_limit ? -1 : absint( $download_limit ) );
}