LLMS_Product::has_restrictions()

Determine if any restrictions exist on the product.


Description Description

See also See also


Top ↑

Return Return

(boolean) true if there is at least one restriction on the product, false otherwise.


Top ↑

Source Source

File: includes/models/model.llms.product.php

	public function has_restrictions() {

		$restrictions     = $this->get_restrictions();
		$has_restrictions = count( $restrictions ) > 0;

		/**
		 * Filter whether the product has any purchase restrictions.
		 *
		 * @since 3.38.0
		 *
		 * @param bool         $has_restrictions Whether the product `$product` has restrictions.
		 * @param string[]     $restrictions     Array of restrictions placed on the product.
		 * @param LLMS_Product $product          The LLMS_Product object.
		 */
		return apply_filters( 'llms_product_has_restrictions', $has_restrictions, $restrictions, $this );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.38.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.