WordPress at Your Fingertips
function is not described

WC_Coupon::set_limit_usage_to_x_items() public WC 3.0.0

Set usage limit to x number of items.

{} It's a method of the class: WC_Coupon{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Coupon = new WC_Coupon();
$WC_Coupon->set_limit_usage_to_x_items( $limit_usage_to_x_items );
$limit_usage_to_x_items(int|null) (required)
Limit usage to X items.

Changelog

Since 3.0.0 Introduced.

Code of WC_Coupon::set_limit_usage_to_x_items() WC 5.6.0

public function set_limit_usage_to_x_items( $limit_usage_to_x_items ) {
	$this->set_prop( 'limit_usage_to_x_items', is_null( $limit_usage_to_x_items ) ? null : absint( $limit_usage_to_x_items ) );
}