LLMS_Voucher::is_product_to_voucher_link_valid( string $code, int $product_id )
Determine if the product is linked to a voucher by code
Parameters Parameters
- $code
-
(string) (Required) Voucher code string.
- $product_id
-
(int) (Required) WP_Post ID of the product (course or membership).
Return Return
(boolean)
Source Source
File: includes/class.llms.voucher.php
public function is_product_to_voucher_link_valid( $code, $product_id ) { $voucher = $this->check_voucher( $code ); if ( $voucher ) { $this->id = $voucher->voucher_id; $products = $this->get_products(); if ( ! empty( $products ) && in_array( $product_id, $products ) ) { return true; } } return false; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |