public/wordpress/wp-content/plugins/wp-courseware/includes/models/course.php
/**
	 * Update Instructor.
	 *
	 * @since 4.5.2
	 *
	 * @param int  $instructor_id The instructor id to will become the new instructor.
	 * @param bool $update_questions Update all associations with this course. Default is True.
	 */
Update Instructor.

@param int  $instructor_id The instructor id to will become the new instructor.
@param bool $update_questions Update all associations with this course. Default is True.
Update Instructor . @param int $instructor_id The instructor id to will become the new instructor . @param bool $update_questions Update all associations with this course . Default is True .
public function update_instructor( $instructor_id, $update_questions = true ) {
		$this->set_prop( 'course_author', absint( $instructor_id ) );
		if ( $modules = $this->get_modules() ) {
			foreach ( $modules as $module ) {
				$module->update_author( $instructor_id );
			}
		}
		if ( $units = $this->get_units() ) {
			foreach ( $units as $unit ) {
				$unit->update_author( $instructor_id );
			}
		}
		if ( $quizzes = $this->get_quizzes() ) {
			foreach ( $quizzes as $quiz ) {
				$quiz->update_author( $instructor_id, $update_questions );
			}
		}
		$this->save();
	}
public function update_instructor ( $ instructor_id , $ update_questions = true ) { $ this -> set_prop ( 'course_author' , absint ( $ instructor_id ) ) ; if ( $ modules = $ this -> get_modules ( ) ) { foreach ( $ modules as $ module ) { $ module -> update_author ( $ instructor_id ) ; } } if ( $ units = $ this -> get_units ( ) ) { foreach ( $ units as $ unit ) { $ unit -> update_author ( $ instructor_id ) ; } } if ( $ quizzes = $ this -> get_quizzes ( ) ) { foreach ( $ quizzes as $ quiz ) { $ quiz -> update_author ( $ instructor_id , $ update_questions ) ; } } $ this -> save ( ) ; }
Update Instructor.
Update Instructor .
/** @var Module $module */ /** @var Unit $unit */ /** @var Quiz $quiz */