Support » Requests and Feedback » loginout and “redirect to”

  • Could this funciton adjusted to return you to the page where ou called it from. For the most part protectyed pages (for example the wp-admin pages) are redirected to the the login and then back… however, if you use the wp_loginout function in your theme, you end up on the dashboard, not at the main page of your site.

    an option to do this would be a good thing, or support for a plugin to control it???

Viewing 3 replies - 1 through 3 (of 3 total)
  • whooami



    Ive done it 🙂 login and youre redirected back to blog AND it “tells” you that youre logged in.
    Short answer: yes it can be done


    Would you care to share this information at all?

    Add this to your side bar. 😀

    However, I still cant figure out how to make it so when you logoff and go to back to page you came from, that is, its ignoreing “action=logout&redirect_to=” . 🙁 Any ideas?

    global $user_ID, $user_identity;
    if (!$user_ID):
    <h2><?php _e('Sign In'); ?></h2>
    <ul style="text-align: center;">

    <form name="loginform" id="loginform" action="<?php echo get_settings('siteurl'); ?>/wp-login.php" method="post">
    <div><label style="color:red"><?php _e('User Name') ?>:<br /> <input type="text" name="log" id="log" value="" size="20" tabindex="7" /></label><br /><br />
    <label style="color:red"><?php _e('Password') ?>:<br /> <input type="password" name="pwd" id="pwd" value="" size="20" tabindex="8" /></label><br /><br />
    <input type="submit" name="submit" value="<?php _e('Sign In'); ?> &raquo;" tabindex="9" />
    <input type="hidden" name="redirect_to" value="<?php echo convert_chars($_SERVER['REQUEST_URI']); ?>"/></div>

    <h2><?php echo $user_identity; ?></h2>
    <ul style="text-align: center;"><li>
    <a href="<?php echo get_settings('siteurl') . '/wp-login.php?action=logout&amp;redirect_to=' . $_SERVER['REQUEST_URI']; ?>" title="Sign Out"><?php _e('Sign Out'); ?></a>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘loginout and “redirect to”’ is closed to new replies.