LLMS_Shortcodes::pricing_table( array $atts )
Output a Pricing Table anywhere a shortcode can be output
Parameters Parameters
- $atts
-
(array) (Required) Associative array of shortcode attributes.
Return Return
(string)
Source Source
File: includes/shortcodes/class.llms.shortcodes.php
*/ public static function pricing_table( $atts ) { $atts = shortcode_atts( array( 'product' => null, ), $atts, 'lifterlms_pricing_table' ); $ret = ''; // get product id from loop if used from within a course or membership. if ( ! $atts['product'] ) { $id = get_the_ID(); if ( in_array( get_post_type( $id ), array( 'course', 'llms_membership' ), true ) ) { $atts['product'] = get_the_ID(); } } if ( ! empty( $atts['product'] ) && is_numeric( $atts['product'] ) ) { // enqueue match height for height alignments. self::enqueue_script( 'llms-jquery-matchheight' ); ob_start(); lifterlms_template_pricing_table( $atts['product'] ); $ret = ob_get_clean(); } /** * Filters the pricing table shortcode output * * @since unknown * * @param string $ret The shortcode output. * @param array $atts Associative array of shortcode attributes. */ return apply_filters( 'llms_shortcode_pricing_table', $ret, $atts );
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.38.0 | Use in_array() with strict comparison. |
3.23.0 | Unknown. |
3.2.5 | Introduced. |