Hi team,
How to hide the private forums on courses for visitors.
For exemple, here is one of the courses https://e-signos.fr/nos-formations/mind-mapping-1/ and on the left there is the option to go to forum, but the forum is private so when a visitor clic on the forum he found a blank page.
I search the solution on wp-admin / LMS / Settings, but i don't find it. Could you help me ?
Thanks
I just got this request from a client, luckily there's an easy way to accomplish this.
Go to your child theme's functions and just drop this little snippet.
add_filter('wplms_course_nav_menu','cdctps_remove_course_forum',9,1);
function cdctps_remove_course_forum($defaults){
if (!wplms_user_course_check($user_id,$course_id)){ // Check's wether or not the user is enrolled
$key = 'forum'; //You may need to change it accordding your language
unset($defaults[$key]); //Remove forum tab for non-enrolled users
}
return $defaults;
}
If you're not using a child theme (and you really should), you may consider creating a site-specific plugin.
@urdek: thanks for the code.
@masuccijr:Yes you can use the above code for hiding the forums.
Thanks Urdek,
I not have a Child Theme, but i think i will go to create it and try your solution.
You can also paste the code in wplms-customizer.php file present in your wplms customizer plugin.
Thanks, that's works on wplms customizer.