wp_redirect() does not work when the plugin is active
-
Hi there, we are using your plugin for 2-factor auth with Google Authenticator. It works great, but we had a redirection configured for certain user role. The code looks like this:
function redirect_retail_page_based_on_role($user) { $user_roles = (array) $user->roles; if ( in_array('role-one', $user_roles) ) { wp_redirect( home_url() . '/page-one-shop' ); exit(); } elseif (in_array('role-two', $user_roles) ) { wp_redirect( home_url() . '/page-two-shop' ); exit(); } else{ wp_redirect( home_url() ); exit(); } } add_action('after_password_reset', 'redirect_retail_page_based_on_role', 10, 1 );
Deactivating the plugin solves the issue, is there anything that we can do for fixing this?
Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘wp_redirect() does not work when the plugin is active’ is closed to new replies.