LLMS_Controller_Lesson_Progression::handle_incomplete_form()

Mark Lesson as incomplete


Description Description

  • Incomplete Lesson form post.
  • Marks lesson as incomplete and returns incompletion message to user.

Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/controllers/class.llms.controller.lesson.progression.php

	public function handle_incomplete_form() {

		$lesson_id = $this->get_lesson_id_from_form_data( 'incomplete' );

		if ( is_null( $lesson_id ) ) {
			return;
		}

		/**
		 * Filter to modify the user id instead of current logged in user id.
		 *
		 * @param int $user_id User id to mark lesson as incomplete.
		 *
		 * @since 5.4.0
		 */
		$user_id = apply_filters( 'llms_lesson_incomplete_user_id', get_current_user_id() );

		// Mark incomplete and add a notice on success.
		if ( llms_mark_incomplete( $user_id, $lesson_id, 'lesson', 'lesson_' . $lesson_id ) ) {
			// Translators: %s is the title of the lesson.
			llms_add_notice( sprintf( __( 'The lesson %s is now marked as incomplete.', 'lifterlms' ), get_the_title( $lesson_id ) ) );
		}

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.29.0 Unknown.
3.17.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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