Elite

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Hide tabs for instructor only #374013
    Elite
    Participant
    Any workaround? Is it possible to activate by default any of the other visible tabs when entering to view the course?
    in reply to: Hide tabs for instructor only #373958
    Elite
    Participant
    Thanks for response, I adjusted the code for the "Admin" and "Edit Course" tabs:
    add_filter('bp_course_api_get_instructor_tabs',function($tabs,$course_id,$user_id=null){
      $t = [];
      if(!user_can($user_id,'manage_options')){
        foreach($tabs as $k => $tab){
            if($tab['key']=='admin' || $tab['key']=='edit_course'){
              
            }else{
                $t[] = $tab;
            }
          }
        }else{
        	return $tabs;
        }
      return $t;
    },10,3);
    And it no longer shows the tabs to the instructor, only to the administrator, however, the content of the "Admin" tab continues loading by default for the instructor, which would still allow him to remove students from the course and that's one of the things I want to avoid. https://drive.google.com/file/d/1rFvtVVOE9AXiqPexivMjuw39EW1oAPrz/view?usp=sharing
    in reply to: Hide tabs for instructor only #373689
    Elite
    Participant
    This reply has been marked as private.
    in reply to: Hide tabs for instructor only #373602
    Elite
    Participant
    My settings are the same https://drive.google.com/file/d/1Ej1CAq72G10Is2gAIZGt8tW8bRU7iQVA/view?usp=sharing If I put the code in the WPLMS Customizer plugin the result is the same, both the administrator user and the instructor do not see the tabs (but the content of the "Admin" tab is shown at the bottom), if I remove the code, it shows me the "Admin" and "Edit Course" tabs for both.
Viewing 4 posts - 1 through 4 (of 4 total)