code help

Home Forums Legacy Support 4.0 Bugs & Issues code help

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #366634
    EduMEE2
    Participant
    https://share.getcloudapp.com/xQu6P9J8 i want to hide some of the tabs from here but i cant because therre is no class / id selector. i want to hide these tabs q&n notes forums this is not working .vibebp_main>.mycourses .course_manage .course_tabs .instructor_tabs span:nth-child(5){ display: none !important; } it is hiding different different data on load. its not stable. i need php codes
    #366703
    Veronica
    Moderator
    hi use this code:
    
    add_action('wp_head', 'hide_instructor_menu_tabs');
    
      function hide_instructor_menu_tabs() {
        $user = wp_get_current_user();
        
        
        ?>
        <style>
    add you CSS here
    </style>
    <?php 
      
    }
    #366717
    EduMEE2
    Participant
    This reply has been marked as private.
    #366786
    Veronica
    Moderator
    use this within the above code: .vibebp_main .course_overview .course_manage .course_tabs .instructor_tabs :nth-child(6) , .vibebp_main .course_overview .course_manage .course_tabs .instructor_tabs :nth-child(5), .vibebp_main .course_overview .course_manage .course_tabs .instructor_tabs :nth-child(4){ display:none !important; } before: http://i.prntscr.com/MZu7D0dbSx2srr0yQdhm3A.png after: http://i.prntscr.com/7uhdqneqSbaLg5VVc0mYIA.png
    #366843
    EduMEE2
    Participant
    This reply has been marked as private.
    #366915
    Anshuman Sahu
    Keymaster
    Well we have provided this hook : wplms_get_student_mmy_course_tabs you can use it to remove the tabs completely :
    add_filter('wplms_get_student_mmy_course_tabs',function($tabs,$body,$req){
    	        $this->user = apply_filters('vibebp_api_get_user_from_token','',$body['token']);
    	        if(user_can($this->user->id,'manage_options')){
    	        	//its admin
    	        }elseif(user_can($this->user->id,'manage_options')){
    	        	//its inst
    	        }else{
    	        	//its student
    	        }
    	        unset($tabs['overview']);
    			return $tabs;
    		},10,3);
    #366969
    EduMEE2
    Participant
    This reply has been marked as private.
    #366970
    EduMEE2
    Participant
    This reply has been marked as private.
    #367196
    EduMEE2
    Participant
    This reply has been marked as private.
    #367244
    Anshuman Sahu
    Keymaster
    1 . to hide tabs fro students : add this code in your wplms-customizer.php file in wplms customizer plugin :
    add_filter('wplms_get_student_mmy_course_tabs',function($tabs,$body,$req){
    	        $this->user = apply_filters('vibebp_api_get_user_from_token','',$body['token']);
    	        if(!user_can($this->user->id,'edit_posts')){
    	        	unset($tabs['announcementsnews']);
    unset($tabs['qna']);
    unset($tabs['notes']);
    	        }
    	        
    			return $tabs;
    		},10,3);
    2 . to hide for inst : add this code in your wplms-customizer.php file in wplms customizer plugin :
    add_filter('bp_course_api_get_instructor_tabs',function($tabs,$course_id,$user_id=null){
      $t = [];
      foreach($tabs as $k => $tab){
        if(!($tab['key']=='reviews' || $tab['key']=='qna')){
          $t[] = $tab;
        }
      }
    
      return $t;
    },10,3);
    #367505
    EduMEE2
    Participant
    This reply has been marked as private.
    #367712
    Veronica
    Moderator
    closing this one
Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘code help’ is closed to new replies.