WordPress.org

Support

Support » Plugins and Hacks » [Plugin: AJAX Login Widget ] Errors when logging out

[Plugin: AJAX Login Widget ] Errors when logging out

Viewing 4 replies - 1 through 4 (of 4 total)
  • marco2020
    Member

    @marco2020

    hi,

    i’m not good with coding – where do i place the above code?

    thanks in advance – Mark

    marco2020
    Member

    @marco2020

    all sorted thanks – learning more and more about this wordpress stuff!!

    DivaVocals
    Member

    @divavocals

    Dalton Rooney’s fix did correct the error, but did not leave me on the page I was viewing when I logged out. (And isn’t that the BIGGEST reason we all want this plugin?? 🙂 )

    For example I was viewing a blog category page and if I logged out while there in stead of staying on the page I was on, I was redirected to the post page for the 1st post in the category I was viewing.

    So following some info I found here:
    http://codex.wordpress.org/Function_Reference/get_permalink

    I made the following changes to the file

    ajax-login-widget/alw_template.php

    .
    .
    .
    Find this (it’s towards the end of this file):
    (<a href="<?php echo wp_logout_url('/wp-login.php?action=logout&redirect_to=' . $_SERVER['REQUEST_URI']); ?>">log out</a>)
    .
    .
    .
    Change to:
    (<a href="<?php echo esc_url( wp_logout_url( $_SERVER['REQUEST_URI'] ) ); ?>">log out</a>)
    .
    .
    .
    This will fix the logout error and leave you on the page you were viewing when you log out. Hope that helps someone.. I really like this plugin, but I fear it’s starting to show signs of it’s age after not being updated in nearly 2 years.. 🙁
    .
    .
    .

    Edited to add: I am using this posted fix with WordPress v3.2.1 in case anyone is interested..

    I was having a similar problem with logging out, but needed a redirect to a certain page… Here is a link that explains it all!

    Default Usage

    <a href="<?php echo wp_logout_url(); ?>" title="Logout">Logout</a>

    Logout and Redirect to Current Page

    <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="Logout">Logout</a>

    Logout and Redirect to Homepage

    <a href="<?php echo wp_logout_url( home_url() ); ?>" title="Logout">Logout</a>

    Logout and Redirect to Another Site

    If you are using wp_logout_url to redirect to another site on logout (e.g. another subsite in a MultiSite network) you’ll need to make use of the allowed_redirect_hosts filter

    add_filter('allowed_redirect_hosts','allow_ms_parent_redirect');
    function allow_ms_parent_redirect($allowed)
    {
        $allowed[] = 'multisiteparent.com';
        return $allowed;
    }
    
    <a href="<?php echo wp_logout_url( 'http://multisiteparent.com' ); ?>" title="Logout">Logout</a>
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: AJAX Login Widget ] Errors when logging out’ is closed to new replies.