CoursePress Pro WordPress Backend and Students AND no redirect for admins

Hi Gurus,

I enabled the custom login and redirect for students but I've found something I don't know how to change. If the student wants to change their profile they get redirected to the backend User profile screen. Because students have to be subscribers, they see the admin menu and a few plugins they can use like Private messaging. However, there is no admin menu option to get back to your enrolled courses. and because the student is in the backend at that point, they don't see the frontend primary menu. How can I provide a link back to their student dashboard on the admin side?

Second, because I don't want students to immediately go to the backend, I turned on redirect after login, however, when I login as an administrator now, it forces a redirect for that as well. Can I turn off redirect for administrators?

Lastly, to confirm. In order to manually add a student to a course, I need to create a new WordPress user of type subscriber first, and then navigate to the course I want to enroll him/her into, and then manually add him/her to that course.

That process seems overly complicated. Why can't I just add a new student to the course I want from that screen?

Thanks team!

  • Sajid

    Hello emilio_gagliardi,
    Hope you are doing good today :slight_smile:

    To have a button to go back to CoursePress dashboard from edit profile page. Add following code in functions.php file of your child theme or use it as mu-plugin.

    function numediaweb_custom_user_profile_fields(){
    	$cp_dashboard_link = get_site_url('', 'courses-dashboard');?>
    
    	 <a class=&quot;backtocpdash&quot; href=&quot;<?php echo $cp_dashboard_link ?>&quot;>Back to Dashboard</a>;
    	 <style type=&quot;text/css&quot;>
    	 	.backtocpdash{
    	 		position: fixed;
    	 		top: 80px;
    	 		right: 50px;
    	 		padding: 25px;
    	 		background: #3b88c0;
    	 		color: #FFF;
    	 	}
    	 </style>
    <?php }
    
    add_action('show_user_profile', 'numediaweb_custom_user_profile_fields');

    This should have a sticky blue button on top right corner of the page as seen in below screenshot.

    I could replicate the issue of redirecting user to Students Dashboard plugin instead of admin area. I am marking it as confirmed bug and notifying the developer so it could be patched up in next version of the plugin.

    To add a user manually, there is a form that can be used to invite students who are not registered users. That does actually create a user if they accept the invitation.

    If you want a feature like this, then please create a new thread in Features and Feedback section. From where this may considered for development.

    Take care and have a nice day :slight_smile:

    Best Regards,
    Sajid

  • Paula

    Hi!

    Having the same problem.

    Two issues:

    1) I don't think it's the most fabulous user experience to have students (many of my students are non-technical) into the Wordpress backend.
    2) Assuming that this is the best way to resolve (rather than prevent) this problem, I'm having some trouble adding the button.

    Copied the code, but am not having any luck adding it to the function.php. Keep getting the message (Something went wrong.) and it won't save my addition.

    function numediaweb_custom_user_profile_fields(){
    $cp_dashboard_link = get_site_url('', 'courses-dashboard');?>

    ">Back to Dashboard;
    <style type="text/css">
    .backtocpdash{
    position: fixed;
    top: 80px;
    right: 50px;
    padding: 25px;
    background: #3b88c0;
    color: #FFF;
    }
    </style>
    <?php }

    add_action('show_user_profile', 'numediaweb_custom_user_profile_fields');

    Please advise.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.