Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Hide span for instructor
- This topic has 16 replies, 4 voices, and was last updated 3 years, 2 months ago by Veronica.
-
AuthorPosts
-
January 19, 2021 at 10:37 pm #335094lepeolmedoSpectatorHi! I need some help. I can't display:none to two <span> I would like to unable. https://prnt.sc/x8os1g The thing is, I want the instructor to have all the other options, but not those two. Thanks.January 20, 2021 at 7:31 am #335159AdaParticipantHi, For this you need to install and activate wplms-customizer plugin Then goto plugin editor>> wplms-customizer> wplms-customizer.php Add this code
You can download plugin from here https://wplms.io/support/knowledge-base/wplms-customizer-plugin/function hide_span_edit() { $user = wp_get_current_user(); if ( in_array( 'instructor', (array) $user->roles ) ) { //The user has the "instructor" role ?> <style> #vibebp_member .course_manage .course_tabs .instructor_tabs span:last-child{ display:none !important; } #vibebp_member .course_manage .course_tabs .instructor_tabs span:nth-child(7){ display:none !important; } </style> <?php } } add_action('wp_head', 'hide_span_edit');
January 21, 2021 at 10:07 pm #335648lepeolmedoSpectatorHi, Worked great yesterday. After WPLMS and VibeBP last update is not working any more. https://prnt.sc/xe7pe9January 22, 2021 at 7:49 am #335713AdaParticipantHi Check your code
in this line it should be instructor not Instructor. Please correct this and then check.if ( in_array( 'instructor', (array) $user->roles ) )
January 22, 2021 at 8:17 pm #335883lepeolmedoSpectatorHi, Worked first time when I changed "instructor" to "Instructor" (I saw the user roles in WP was actually with I, not i). but now does not work with either of the 2 options. Anyway, I would prefer to display:none to this entire sector for instructors only. https://prnt.sc/xgt6nl This will restrict both sector for the instructor. Could you help me with this please? Thanks.January 23, 2021 at 9:53 am #335963AdaParticipantHi I am not able to add code in your plugin editor https://prntscr.com/xhtdhw So Please use this updated code to hide the span for instructor account Add it in wplms-customizer.phpfunction hide_instructor_span_edit() { $user = wp_get_current_user(); if ( current_user_can('edit_posts') && !current_user_can('manage_options')) { //The user has the "instructor" role ?> <style> #vibebp_member .vibebp_main .course_manage .course_tabs .instructor_tabs span:last-child{ display:none !important; } #vibebp_member .vibebp_main .course_manage .course_tabs .instructor_tabs span:nth-child(7){ display:none !important; } </style> <?php } } add_action('wp_head', 'hide_instructor_span_edit');
January 23, 2021 at 10:00 am #335964AdaParticipantOr If you want to hide complete manage course section from instructor account then use this code at same placefunction hide_instructor_manage() { $user = wp_get_current_user(); if ( current_user_can('edit_posts') && !current_user_can('manage_options')) { //The user has the "instructor" role ?> <style> #vibebp_member #course_component .vibebp_left_sidebar a.menu-child.manage_courses { display:none !important; } </style> <?php } } add_action('wp_head', 'hide_instructor_manage');
January 23, 2021 at 4:18 pm #336049lepeolmedoSpectatorHi, Is not working. I added the code and the instructor still can manage courses. The code added: https://prnt.sc/xibjxh Share to instructor credentials in the next comment.January 23, 2021 at 4:19 pm #336050lepeolmedoSpectatorThis reply has been marked as private.January 25, 2021 at 11:33 am #336254DianaParticipantSir, While Adding the code from wplms customizer plugin. It is not allowing us to add any code. You need to share either FTP/Cpanel details here in a private reply so that we can check by adding the codeJanuary 25, 2021 at 1:16 pm #336294lepeolmedoSpectatorThis reply has been marked as private.January 27, 2021 at 3:59 pm #336704DianaParticipantThis reply has been marked as private.January 27, 2021 at 5:33 pm #336723lepeolmedoSpectatorThis reply has been marked as private.January 29, 2021 at 8:09 pm #337146lepeolmedoSpectator2 days and hours since last reply. The credentials are working.February 1, 2021 at 8:24 am #337416DianaParticipantThis reply has been marked as private. -
AuthorPosts
- The topic ‘Hide span for instructor’ is closed to new replies.