Reply To: No redirection

#10002593

Pie Register
Keymaster

Hello,

You may try something like that:

add_action("piereg_user_login_before_redirect_hook","pie_custom_redirect_cb",10,1);
function pie_custom_redirect_cb($user){
	if(in_array( "subscriber", (array) $user->roles )){
		wp_safe_redirect('/subscriber-landing-page-slug');
	}elseif(in_array( "editor", (array) $user->roles )){
		wp_safe_redirect('/editor-landing-page-slug');
	}
	return false;
}

Please put this snippet into the functions.php of your theme. Please make sure you make the backup of your file before adding this code, so you can roll back in case of any inconvenience!

This code is not tested, given to you for just to give you an idea of how to implement the redirect based on different User Roles on Pie-Register Login Hook.

If you would like us to write a proper custom code for you, you may request for quote using rfq form at our website.

Thanks
Mohsin