LLMS_Shortcodes::init()

init shortcodes array


Description Description


Return Return

(void)


Top ↑

Source Source

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

	public static function init() {

		// new method
		$scs = apply_filters( 'llms_load_shortcodes', array(
			'LLMS_Shortcode_Course_Author',
			'LLMS_Shortcode_Course_Continue',
			'LLMS_Shortcode_Course_Continue_Button',
			'LLMS_Shortcode_Course_Meta_Info',
			'LLMS_Shortcode_Course_Outline',
			'LLMS_Shortcode_Course_Prerequisites',
			'LLMS_Shortcode_Course_Reviews',
			'LLMS_Shortcode_Course_Syllabus',
			'LLMS_Shortcode_Courses',
			'LLMS_Shortcode_Hide_Content',
			'LLMS_Shortcode_Lesson_Mark_Complete',
			'LLMS_Shortcode_Membership_Link',
			'LLMS_Shortcode_My_Achievements',
			'LLMS_Shortcode_Registration',
		) );

		// include abstracts
		require_once LLMS_PLUGIN_DIR . 'includes/abstracts/abstract.llms.shortcode.php';
		require_once LLMS_PLUGIN_DIR . 'includes/abstracts/abstract.llms.shortcode.course.element.php';

		foreach ( $scs as $class ) {

			$filename = strtolower( str_replace( '_', '.', $class ) );
			$path = apply_filters( 'llms_load_shortcode_path', LLMS_PLUGIN_DIR . 'includes/shortcodes/class.' . $filename . '.php', $class );

			if ( file_exists( $path ) ) {
				require_once $path;
			}
		}

		/**
		 * @deprecated  2.0.0
		 * @todo        deprecate
		 */
		add_shortcode( 'courses', array( LLMS_Shortcode_Courses::instance(), 'output' ) );

		// old method
		$shortcodes = array(
			'lifterlms_access_plan_button' => __CLASS__ . '::access_plan_button',
			'lifterlms_my_account' => __CLASS__ . '::my_account',
			'lifterlms_checkout' => __CLASS__ . '::checkout',
			'lifterlms_course_info' => __CLASS__ . '::course_info',
			'lifterlms_course_progress' => __CLASS__ . '::course_progress',
			'lifterlms_course_title' => __CLASS__ . '::course_title',
			'lifterlms_user_statistics' => __CLASS__ . '::user_statistics',
			'lifterlms_related_courses' => __CLASS__ . '::related_courses',
			'lifterlms_login' => __CLASS__ . '::login',
			'lifterlms_pricing_table' => __CLASS__ . '::pricing_table',
			'lifterlms_memberships' => __CLASS__ . '::memberships',

		);

		foreach ( $shortcodes as $shortcode => $function ) {

			add_shortcode( apply_filters( "{$shortcode}_shortcode_tag", $shortcode ), $function );

		}

	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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