ASTRA_Ext_LearnDash_Markup::llms_learning()

Distraction Free for LLMS Course/Lession Page.


Description


Return

(void)


Source

File: addons/learndash/classes/class-astra-ext-learndash-markup.php

		public function llms_learning() {

			if ( is_singular( 'sfwd-courses' ) || is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-topic' ) || is_singular( 'sfwd-quiz' ) ) {

				$course_id = learndash_get_course_id();
				$user_id   = get_current_user_id();

				if ( astra_get_option( 'learndash-distraction-free-learning' ) && sfwd_lms_has_access( $course_id, $user_id ) ) {

					// HFB Support for distration free checkout.
					if ( true === astra_addon_builder_helper()->is_header_footer_builder_active ) {
						remove_action( 'astra_header', array( Astra_Builder_Header::get_instance(), 'prepare_header_builder_markup' ) );
						remove_action( 'astra_footer', array( Astra_Builder_Footer::get_instance(), 'footer_markup' ), 10 );
					}

					remove_action( 'astra_header', 'astra_header_markup' );
					remove_action( 'astra_footer', 'astra_footer_markup' );

					add_action( 'astra_header', array( $this, 'header_markup' ) );
					add_action( 'astra_footer', array( $this, 'footer_markup' ) );
				}
			}
		}


User Contributed Notes

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