• Resolved fearis

    (@fearis)


    Dear Jeff
    Is there a chance to remove $action from tml_redirect_url filter as my filer is hooked to register or login action and all the time after refreshing page $action is saved, even that you didn’t click on the form.
    Example:
    ## FILTER ##
    function tml_redirect_url( $url, $action ) {
    if (get_the_ID() == 82 ) {
    if ( ‘login’ == $action ) {
    $_SESSION[‘logged-in’] = 1;
    $url = ‘https://redirect’;
    }
    }
    return $url; // always needs to return $url back to the filter
    }
    add_filter( ‘tml_redirect_url’, ‘tml_redirect_url’, 10, 2 );
    ## END FILTER ##
    Scenario: 1. User log-in. User log-out. Refreshing page will trigger tml_redirect_url again and set $_SESSION[‘logged-in’].

    post scriptum
    I’m not using session to verify is somebody is log-in ??

    https://www.ads-software.com/plugins/theme-my-login/

Viewing 1 replies (of 1 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    You’re doing it wrong. You wouldn’t want to mark a user as logged in just by visiting the Login page, would you? You probably want to use the action wp_login.

Viewing 1 replies (of 1 total)
  • The topic ‘tml_redirect_url( $url, $action ) // remove action if possible’ is closed to new replies.