WC_Product_Usage_Notice::has_reached_max_dismissals()private staticWC 1.0

Check whether the user has reached max dismissals of product usage notice.

Метод класса: WC_Product_Usage_Notice{}

Хуков нет.

Возвращает

true|false.

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

$result = WC_Product_Usage_Notice::has_reached_max_dismissals( $user_id, $product_id ): bool;
$user_id(int) (обязательный)
User ID.
$product_id(int) (обязательный)
Product ID.

Код WC_Product_Usage_Notice::has_reached_max_dismissals() WC 9.4.2

private static function has_reached_max_dismissals( int $user_id, int $product_id ): bool {
	$dismiss_count = absint(
		get_user_meta(
			$user_id,
			self::DISMISSED_COUNT_META_PREFIX . $product_id,
			true
		)
	);

	$max_dismissals = self::$current_notice_rule['max_dismissals'];

	return $dismiss_count >= $max_dismissals;
}