Home › Forums › Legacy Support › 4.0 Bugs & Issues › code help
- This topic has 11 replies, 3 voices, and was last updated 2 years, 8 months ago by Veronica.
Viewing 12 posts - 1 through 12 (of 12 total)
-
AuthorPosts
-
July 29, 2021 at 7:43 am #366634EduMEE2Participanthttps://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 codesJuly 30, 2021 at 6:03 am #366703VeronicaModeratorhi 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 }
July 30, 2021 at 9:01 am #366717EduMEE2ParticipantThis reply has been marked as private.July 31, 2021 at 10:23 am #366786VeronicaModeratoruse 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.pngAugust 1, 2021 at 6:22 pm #366843EduMEE2ParticipantThis reply has been marked as private.August 2, 2021 at 2:05 pm #366915Anshuman SahuKeymasterWell 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);
August 3, 2021 at 8:32 am #366969EduMEE2ParticipantThis reply has been marked as private.August 3, 2021 at 8:35 am #366970EduMEE2ParticipantThis reply has been marked as private.August 5, 2021 at 6:15 am #367196EduMEE2ParticipantThis reply has been marked as private.August 5, 2021 at 1:01 pm #367244Anshuman SahuKeymaster1 . to hide tabs fro students : add this code in your wplms-customizer.php file in wplms customizer plugin :
2 . to hide for inst : 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);
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);
August 9, 2021 at 4:20 am #367505EduMEE2ParticipantThis reply has been marked as private.August 11, 2021 at 6:06 am #367712VeronicaModeratorclosing this one -
AuthorPosts
Viewing 12 posts - 1 through 12 (of 12 total)
- The topic ‘code help’ is closed to new replies.