Adding a Duplicate button to duplicate courses

Use plugin : Post duplicator : https://wordpress.org/plugins/post-duplicator/

In this tip we’re going to add a Duplicate switch for courses in the WP Admin panel. A course in WPLMS is a post with meta information, however there are few important rules you need to take care of while implementing a post duplicate function for courses :

a. Do not duplicate the post meta information related to students
b. Since the quizzes can be connected to a particular course you need to implement a quiz duplicate function as well.
c. Since the assignments can be connected to a particular course you need to implement a assignment duplicate function as well.
d. While duplicating Assignments and Quizzes make sure you do not copy the answers and queries.

This tip assumes that the Students attempting the duplicate course is different from the original one.

The below tip will cover all the points and add a duplicate link in the WP Admin panel :

a. Go to WP Admin -> Plugins -> Editor -> WPLMS Customizer -> customizer_class.php

b. Copy the following code in the function _constructor

PHP Code:

c. Copy the following function in the class :

PHP Code: 

Credits to this tutorial : http://rudrastyh.com/wordpress/duplicate-post.html

Was this article helpful?

Related Articles