Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    So, when I’m logged in admin, and I switch to a subscriber user, I can’t swtich back to admin.

    In this situation, you can find the “Switch back” link either in the footer of your site, or, if you have it enabled, in the “Meta” sidebar widget.

    Failing that, there’s always a “Switch back” link on the login screen if you manually navigate to example.com/wp-login.php

    John

    Thread Starter gverhaeg

    (@gverhaeg)

    John,
    Excatly, I can’t switch back to admin because I’m logged to a subscriber user who have the admin tool bar disabled and no side bar was displayed.
    It’s just a simple user with no rights.
    I can find the following “Switch back” link in the footer of my site:
    http://www.xit745.ovh/xit745/wplogin.php?action=switch_to_olduser&wponce=6be7e9e631&redirect_to=http://www.xit745.ovh/xit745/
    What is 6be7e9e631 ???

    Another method to solve my problem is to display the admin tool bar for each user, but I would like to hide the possibility to update the profil user an to go in the dashboard.

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    What is 6be7e9e631 ???

    This is a WordPress security token called a nonce. It prevents other users form being able to trick you into performing administrative actions.

    It’s strange that there is no link in the footer of your site. If your footer contains a call to wp_footer() then it should show up.

    Failing that, if you want to add your own “Switch back” link somewhere, then give the following code a try.

    <?php
    if ( $old_user = user_switching::get_old_user() ) {
    	$url = user_switching::switch_back_url( $old_user );
    	echo '<a href="' . esc_url( $url ) . '">Switch back</a>';
    }
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘switching to admin_user through an http:// command’ is closed to new replies.