Changing Slugs in WPLMS

From version 1.6.5 we’ve added the feature called as Custom Slugs. Which means you can now rename the slugs in the WPLMS :

You can rename Course to Courso or Section, units to lesson, quiz to questionnaire etc according to your requirements.

To change the slugs to custom values follow below steps:

STEP 1 : Adding Custom Slugs in WPLMS Customizer

a. Go to WP Admin -> Plugins -> Editor -> WPLMS Customizer -> Customizer_class.php
b. Add the following line in _construct function :

PHP Code:

add_action('plugins_loaded',array($this,'wplms_define_constants'),5);

c. Add the following function in the Class and make the necessary slug changes in the function :

PHP Code:

function wplms_define_constants(){
 
            if ( ! defined( 'WPLMS_COURSE_SLUG' ) )
                define( 'WPLMS_COURSE_SLUG', 'section' );
            if ( ! defined( 'BP_COURSE_SLUG' ) )
                define( 'BP_COURSE_SLUG', 'section' );
 
            if ( ! defined( 'WPLMS_COURSE_CATEGORY_SLUG' ) )
                define( 'WPLMS_COURSE_CATEGORY_SLUG', 'course-cat' );
 
            if ( ! defined( 'WPLMS_UNIT_SLUG' ) )
                define( 'WPLMS_UNIT_SLUG', 'lesson' );
 
            if ( ! defined( 'WPLMS_QUIZ_SLUG' ) )
                define( 'WPLMS_QUIZ_SLUG', 'quiz' );
 
            if ( ! defined( 'WPLMS_QUESTION_SLUG' ) )
                define( 'WPLMS_QUESTION_SLUG', 'question' );
 
            if ( ! defined( 'WPLMS_EVENT_SLUG' ) )
                define( 'WPLMS_EVENT_SLUG', 'event' );
 
            if ( ! defined( 'WPLMS_ASSIGNMENT_SLUG' ) )
                define( 'WPLMS_ASSIGNMENT_SLUG', 'assignment' );
 
            if ( ! defined( 'WPLMS_LEVEL_SLUG' ) )
                define( 'WPLMS_LEVEL_SLUG', 'level' );
 
            if ( ! defined( 'BP_COURSE_RESULTS_SLUG' ) )
                define( 'BP_COURSE_RESULTS_SLUG', 'results' );
 
            if ( ! defined( 'BP_COURSE_STATS_SLUG ' ) )
                define( 'BP_COURSE_STATS_SLUG', 'stats' );
 
        }

Note : in above example I’ve renamed Courses to “Section and units to lesson””


STEP 2 : Re-save Permalinks

a. Go to WP admin -> Settings -> Permalinks
b. Re-save the permalinks to Post name that is %postname%

Watch below video tutorial on how to customize slugs and use translation files to rename the labels :