Change Primary/Main Author of a Course

As Tutor LMS has no built-in primary/main author change option, you will need to do some tweaks to change the primary/main author for the courses that are created.

First of all, you will need to disable Gutenberg author support for sometime from Tutor LMS plugin. Before you start, make sure you are working on a child theme.

Now, go to this path wp-content/plugins/tutor/classes/Course.php on line no 46, you will see the code that enables Gutenberg author support for  “Courses” custom post type.

// add_filter('wp_insert_post_data', array($this, 'tutor_add_gutenberg_author'), '99', 2);

Comment the given line, because it’s better to activate that code again after changing the author. Then place this piece of code block in your child theme’s functions.php file

function tutor_primary_author() {
if ( function_exists('tutor')) {
		$tutor_post_type = tutor()->course_post_type;
		add_post_type_support( $tutor_post_type, 'author' );
	}
}
add_action('init', 'tutor_primary_author', 999 );

After that, you will find the option to change the instructor from the course quick edit view or from the backend editor. . But make sure you are logged in an Administrator account. Also to whom you will handover the course will need to have Administrator role permission. . 

Change Course Author on Quick Edit View


Change Course Author From the Backend.

Watch the video below to check how it is done.

Link: https://www.youtube.com/watch?v=bFeswvVoSfE

After changing the author successfully, you can now remove the comment from line no 46 at Course.php file in Tutor LMS core plugin

Was this helpful?