LLMS_Lesson_Handler::duplicate_lesson( $course_id,  $section_id,  $lesson_id )


Source Source

File: includes/class.llms.lesson.handler.php

	public static function duplicate_lesson( $course_id, $section_id, $lesson_id ) {

		if ( ! isset( $course_id ) || ! isset( $section_id ) || ! isset( $lesson_id ) ) {
			return false;
		}

		// Duplicate the lesson.
		$new_lesson_id = self::duplicate( $lesson_id );

		if ( ! $new_lesson_id ) {
			return false;
		}

		// Add parent section and course to new lesson.
		update_post_meta( $new_lesson_id, '_llms_parent_section', $section_id );
		update_post_meta( $new_lesson_id, '_llms_parent_course', $course_id );

		return $new_lesson_id;

	}


Top ↑

User Contributed Notes User Contributed Notes

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