Hello ... I wanted to know if you can do so by clicking on the name of a teacher in the block course will be redirected to the instructing-courses of the same teacher and not to his profile.
Same thing when I click cul name of the teacher in the course page.
I attach screenshots
Add this code :
add_filter('bp_core_get_user_domain','show_instructing_courses_on_instructor_profile',10,2);
function show_instructing_courses_on_instructor_profile($link,$user_id){
return get_author_posts_url($user_id).'instructing-courses/';
}
Hello Alex,
excuse but where do I add this code? perhaps customizer_class.php? or wplms-customizer.php in wplms-customizer plugin?
sorry ... I solved.
Added code in wplms-customizer.php in wplms-customizer plugins.
Thank you
Hello Alex,
I'm sorry but I noticed something wrong with the code that you suggested.
Now clicking on the name of the teacher I can reach the page instructing course-but if I am a teacher I can not go on my profile page using logged menu panel.
How can I fix this?
Bump for this @alex
I added a conditional to only redirect instructors and a variable for 'instructing courses' slug, but I also need a fix for this.
The code I'm using should it help anyone:
add_filter('bp_core_get_user_domain','show_instructing_courses_on_instructor_profile',10,2);
function show_instructing_courses_on_instructor_profile($link,$user_id){
if(user_can($user_id,'edit_posts')){
$instructing_courses=apply_filters('wplms_instructing_courses_endpoint','instructing-courses');
return get_author_posts_url($user_id).$instructing_courses;
}
return $link;
}