Super Instructor

A super instructor is an instructor to whom the Instructor privacy does not apply. Super instructor is an instructor which has all units, courses, quizzes access and can view these. This is a normal instructor without the Instructor privacy “on”, which means all the instructors are super instructors when the Instructor privacy is “off”. However, when Instructor privacy is “on” all other instructors can not view each others units except for super instructor.

Pre-requirement :

a. We need list of instructor ids of Super instructors, example : 8,9,10 for tip

Here’s you can can enable this functionality :

1. Go to WP Admin -> plugins -> editor -> wplms customizer -> customizer_class.php
2. Locate the function _construct and add the following line of code in it :

PHP Code:
add_filter('wplms_frontend_cpt_query',array($this,'custom_wplms_frontend_cpt_query'),20);
add_filter('wplms_backend_cpt_query',array($this,'custom_wplms_frontend_cpt_query'),20);

3. Add the following function in the class :

PHP Code:
function custom_wplms_frontend_cpt_query($args){
    $super_instructors = array(8,9,10);
   global $current_user;
    get_currentuserinfo();
        
  if(in_array($current_user->ID,$super_instructors)){
     unset($args['author']);
   }     
  
return $args;
}