LLMS_Frontend_Assets::enqueue_scripts()

Enqueue Scripts


Return Return

(void)


Top ↑

Source Source

File: includes/class.llms.frontend.assets.php

	 */
	public static function enqueue_scripts() {

		// I don't think we need these next 3 scripts.
		wp_enqueue_script( 'jquery-ui-tooltip' );
		wp_enqueue_script( 'jquery-ui-datepicker' );
		wp_enqueue_script( 'jquery-ui-slider' );

		llms()->assets->enqueue_script( 'webui-popover' );

		llms()->assets->register_script( 'llms-jquery-matchheight' );
		if ( is_llms_account_page() || is_course() || is_membership() || is_lesson() || is_memberships() || is_courses() || is_tax( array( 'course_cat', 'course_tag', 'course_difficulty', 'course_track', 'membership_tag', 'membership_cat' ) ) ) {
			llms()->assets->enqueue_script( 'llms-jquery-matchheight' );
		}

		llms()->assets->enqueue_script( 'llms' );

		llms()->assets->register_script( 'llms-notifications' );
		if ( get_current_user_id() ) {
			llms()->assets->enqueue_script( 'llms-notifications' );
		}

		// Doesn't seem like there's any reason to enqueue this script on the frontend.
		wp_enqueue_script( 'llms-ajax', LLMS_PLUGIN_URL . 'assets/js/llms-ajax' . LLMS_ASSETS_SUFFIX . '.js', array( 'jquery' ), llms()->version, true );

		// I think we only need this on account and checkout pages.
		llms()->assets->enqueue_script( 'llms-form-checkout' );

		if ( is_singular( 'llms_quiz' ) ) {
			llms()->assets->enqueue_script( 'llms-quiz' );
		}

		llms()->assets->register_script( 'llms-favorites' );
		if ( ( is_lesson() || is_course() ) && true === llms_is_favorites_enabled() ) {
			llms()->assets->enqueue_script( 'llms-favorites' );
		}

		llms()->assets->register_script( 'llms-iziModal' );
		if ( is_llms_account_page() ) {
			llms()->assets->enqueue_script( 'llms-iziModal' );


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Enqueue locale data and dependencies on account and checkout pages for searchable dropdowns for country & state. Remove password strength inline enqueue.
4.4.0 Enqueue & register scripts using LLMS_Assets methods. Add Add window.llms.ajax_nonce data to replace wp_ajax_data.nonce. Moved inline scripts to enqueue_inline_scripts().
4.0.0 Remove dependencies "collapse" and "transition".
3.36.0 Localize tracking with client-side settings.
3.35.0 Explicitly define asset versions.
3.22.0 Unknown.
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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