LLMS_Shortcodes::user_statistics( array $atts )

Output user statistics related to courses enrolled, completed, etc.


Description Description

..


Top ↑

Parameters Parameters

$atts

(array) (Required) Associative array of shortcode attributes.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/shortcodes/class.llms.shortcodes.php

		}

	}

	/**
	 * Output a Pricing Table anywhere a shortcode can be output
	 *
	 * @since 3.2.5
	 * @since 3.23.0 Unknown.
	 * @since 3.38.0 Use `in_array()` with strict comparison.
	 *
	 * @param array $atts Associative array of shortcode attributes.
	 * @return string
	 */
	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 );

	}

}

return new LLMS_Shortcodes();

Top ↑

Changelog Changelog

Changelog
Version Description
unknown unknown
3.38.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.