LLMS_Blocks_Pricing_Table_Block::output( array $attributes = array() )
Output the pricing table.
Description Description
Parameters Parameters
- $attributes
-
(array) (Optional) Block attributes.
Default value: array()
Return Return
(void)
Source Source
File: vendor/lifterlms/lifterlms-blocks/includes/blocks/class-llms-blocks-pricing-table-block.php
public function output( $attributes = array() ) { if ( 'edit' === filter_input( INPUT_GET, 'context' ) ) { $id = filter_input( INPUT_GET, 'post_id', FILTER_SANITIZE_NUMBER_INT ); if ( $id ) { $product = new LLMS_Product( $id ); if ( ! $product->get_access_plans() ) { echo '<p>' . __( 'No access plans found.', 'lifterlms' ) . '</p>'; } } // force display of the table on the admin panel. add_filter( 'llms_product_pricing_table_enrollment_status', '__return_false' ); add_filter( 'llms_product_is_purchasable', '__return_true' ); } lifterlms_template_pricing_table( $attributes['post_id'] ); remove_filter( 'llms_product_pricing_table_enrollment_status', '__return_false' ); remove_filter( 'llms_product_is_purchasable', '__return_true' ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |