Impersonate next user without logging out of previous user
-
Hi,
Love the plugin! One issue we have is that we login to many different users in a row. By default, the plugin requires us to logout of the old user (going back to the admin user) before logging into the next user. We tried to modify this behavior with this code:
add_filter ('wp_redirect', 'dscsa_wp_redirect'); function dscsa_wp_redirect($location) { //If Admin is impersonating user and tries to impersonate a different user before logging out of old user, they will be redirected to old users page //So we logout of that user first then redirect to that page again if (is_impersonating() AND trying_to_impersonate_next_user()) { //Destroy current impersonated session so that we go back to admin wp_destroy_current_session(); wp_logout(); //Now that we are in admin we should be able to impersonate next user return home_url('/wp-admin?impersonate='.$_GET[impersonate']); } }
But your plugin doesn’t seem to respect the programatic logout above, and we are just sent to the admin page. How best can we achieve this behavior?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Impersonate next user without logging out of previous user’ is closed to new replies.