Created
April 8, 2021 09:52
-
-
Save MrVibe/6f2c94886a2e1d9b9b790021444e634b to your computer and use it in GitHub Desktop.
Restrict Unit types per member
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('wplms_course_creation_tabs',function($tabs,$user_id){ | |
//USER_ID , get Instructor Type | |
if(CONDITION FOR INSTRUCTOR MEMBER TYPE DETECTION) { | |
$unit_types = $tabs['course_curriculum']['fields'][0]['curriculum_elements'][1]['types']; | |
foreach($unit_types as $k=>$type){ | |
if($type['id'] == 'video'){ //Match Unit Type | |
unset($unit_types[$k]); // Unset for Instructor | |
} | |
} | |
$tabs['course_curriculum']['fields'][0]['curriculum_elements'][1]['types'] = $unit_types; | |
} | |
return $tabs; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment