Redirect links teacher name

Home Forums Chit Chat WPLMS customizations Redirect links teacher name

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #10804
    deadelfujiama
    Spectator
    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
    #10973
    Anshuman Sahu
    Keymaster
    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/';   }
    #11012
    deadelfujiama
    Spectator
    Hello Alex, excuse but where do I add this code? perhaps customizer_class.php? or wplms-customizer.php in wplms-customizer plugin?
    #11016
    deadelfujiama
    Spectator
    sorry ... I solved. Added code in wplms-customizer.php in wplms-customizer plugins. Thank you
    #11022
    deadelfujiama
    Spectator
    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?
    #12058
    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; }
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Redirect links teacher name’ is closed to new replies.