Redirect user to author courses page from instrcutor profile page

Please add the given code in your wplms-customizer.php file in wplms customizer plugin at the end before ” ?> ” :

 

add_action('template_redirect','custom_redirect_to_instructing_courses',1);
function custom_redirect_to_instructing_courses(){ 
  if(user_can(bp_displayed_user_id(),'edit_posts') && !bp_is_my_profile()){
     add_action('wp_enqueue_scripts',function(){echo '<script>
           window.location = "'.get_author_posts_url(bp_displayed_user_id()).'instructing-courses";
           </script>';});
   }
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *