Skip to content

Instantly share code, notes, and snippets.

@nayeemch
Created April 7, 2020 11:34
Show Gist options
  • Save nayeemch/426138e8a6bbd8965fc4a0b9d32a1839 to your computer and use it in GitHub Desktop.
Save nayeemch/426138e8a6bbd8965fc4a0b9d32a1839 to your computer and use it in GitHub Desktop.
Add, remove course levels from Tutor LMS Plugin
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