WordPress.org

Ready to get started?Download WordPress

Forums

login/out element and upgrade to 2.7x (2 posts)

  1. syncbox
    Member
    Posted 5 years ago #

    After upgrading a site from a 2.3.3 version to 2.7.1, the login widget in a sidebar that worked just fine previously is now misbehaving.

    The login stuff works as expected. However, after login, this element returns hidden links for logged in users only....

    For example: logout. But strangely, this logout now takes you to a place that says:

    You are attempting to log out of [site name]
    Please try again.

    and there's nothing to click to try again... this is a development site, so I can still try the login/out on the live site and it's working fine (the older version of WordPress)

    Here is my code:

    <?php
    global $user_ID, $user_identity;
    get_currentuserinfo();
    if (!$user_ID):
    ?>
    <h2 class="sbsection"><?php _e('Log In &raquo;'); ?></h2>
    <form name="loginform" id="loginform" action="<?php echo get_settings('siteurl'); ?>/wp-login.php" method="post">
    <div>
    <label for="log"><?php _e('Username') ?>:</label>
    <input type="text" name="log" id="log" value=""  />
    <label for="pwd"><?php _e('Password') ?>:</label>
    <input type="password" name="pwd" id="pwd" value=""  />
    <label for="submit"></label>
    <input type="submit" name="submit" value="<?php _e('Login'); ?> &raquo;"  />
    
    <a href="http://dev.example.net/wp-login.php?action=lostpassword">Lost Password?</a><?php wp_register('', ''); ?>
    <a href="index.php?page_id=47">Contact Us</a>
    
    <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>"/></div>
    </form>
    
    <?php
    else:
    ?>
    <h2 class="sbsection"><?php _e('Logged In &raquo;'); ?></h2>
    
    <ul id="RU">
    <li><em>as: </em><?php echo $user_identity; ?></li>
    <li><a href="http://dev.example.net/wp-admin/profile.php">My Profile</a></li>
    <li><a href="<?php echo get_settings('siteurl') . '/wp-login.php?action=logout&amp;redirect_to=' . $_SERVER['REQUEST_URI']; ?>"><?php _e('Logout'); ?></a></li>
    <li><a href="index.php?page_id=47">Contact Us</a></li>
    </ul>
    <?php
    endif;
    ?>

    (please realize that the ampersands are being converted)
    Any ideas, anyone?

  2. asechrest
    Member
    Posted 5 years ago #

    WP 2.7 doesn't support that way of logging out.

    There should be some solutions for you in this thread.

Topic Closed

This topic has been closed to new replies.

About this Topic