admin管理员组

文章数量:1026205

I want to extend the login session so that I never ever get logged out. Even if Remember me is left unchecked.

This is the code I have at the moment, but it doesn't seem to work with Remember me unchecked:

function extend_login_cookie_expiration( $expiration, $user_id, $remember ) {
    if ( !is_super_admin() ) {
        $expiration = 946708560;
    }
    return $expiration;
}
add_filter( 'auth_cookie_expiration', 'extend_login_cookie_expiration', 10, 3 );

I want to extend the login session so that I never ever get logged out. Even if Remember me is left unchecked.

This is the code I have at the moment, but it doesn't seem to work with Remember me unchecked:

function extend_login_cookie_expiration( $expiration, $user_id, $remember ) {
    if ( !is_super_admin() ) {
        $expiration = 946708560;
    }
    return $expiration;
}
add_filter( 'auth_cookie_expiration', 'extend_login_cookie_expiration', 10, 3 );

本文标签: customizationAlways logged in even if remember me is unchecked