Created
April 7, 2020 11:34
-
-
Save nayeemch/426138e8a6bbd8965fc4a0b9d32a1839 to your computer and use it in GitHub Desktop.
Add, remove course levels from Tutor LMS Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('tutor_course_level', 'add_custom_course_level_tutor'); | |
/** | |
* @param $levels | |
* @return mixed | |
* | |
* Add, remove course levels | |
*/ | |
if ( ! function_exists('add_custom_course_level_tutor')) { | |
function add_custom_course_level_tutor($levels){ | |
/** | |
* Add Levels | |
*/ | |
$levels['custom_level_1'] = __('Custom Level 1', 'text-domain'); | |
$levels['custom_level_2'] = __('Custom Level 2', 'text-domain'); | |
$levels['custom_level_3'] = __('Custom Level 3', 'text-domain'); | |
/** | |
* Remove Level | |
*/ | |
if (isset($levels['existing_level_key'])) { | |
unset($levels['existing_level_key']); | |
} | |
if (isset($levels['existing_level_key_2'])) { | |
unset($levels['existing_level_key_2']); | |
} | |
return $levels; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment