lifterlms_template_pricing_table( int $post_id = null )
Include pricing table for a LifterLMS Product (course or membership)
Parameters Parameters
- $post_id
-
(int) (Optional) WP Post ID of the product. Default is ID of the global $post.
Default value: null
Return Return
(void)
Source Source
File: includes/functions/llms.functions.templates.pricing.table.php
function lifterlms_template_pricing_table( $post_id = null ) {
$post_id = $post_id ? $post_id : get_the_ID();
$product = new LLMS_Product( $post_id );
/**
* Filter current user's enrollment status
*
* This filter is used to customize the output behavior of the pricing table.
* It does not modify the user's enrollment status.
*
* @since Unknown
*
* @param boolean $is_enrolled User's current enrollment status.
*/
$is_enrolled = apply_filters(
'llms_product_pricing_table_enrollment_status',
llms_is_user_enrolled( get_current_user_id(), $product->get( 'id' ) )
);
$purchasable = $product->is_purchasable();
$has_free = $product->has_free_access_plan();
$has_restrictions = $product->has_restrictions();
llms_get_template(
'product/pricing-table.php',
compact( 'product', 'is_enrolled', 'purchasable', 'has_free', 'has_restrictions' )
);
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 6.0.0 | Removed the deprecated and misspelled $purchaseable global variable. |
| 3.38.0 | Fixed spelling error in variable passed to template. |
| 3.0.0 | Introduced. |