Benutzer-Werkzeuge

Webseiten-Werkzeuge


snippets:wp:auto-logout-timeout

WordPress: Define Auto-Logout timeout

Standard-Cookie-Timeout des Logins setzen.

Filter Hook

add_filter( 'auth_cookie_expiration', ( 'callback' | array( 'class', 'callback' ) );

Callback Function

function callback( $expiration_timeout ) {
$timeout_in_seconds = 14 * 24 * 60 * 60; // 14 days
 
return $timeout_in_seconds;
}

Beispiel #1

add_filter( 'auth_cookie_expiration', 'keep_me_logged_in_for_1_year' );
 
function keep_me_logged_in_for_1_year( $expirein ) {
    return 31556926; // 1 year in seconds
}
snippets/wp/auto-logout-timeout.txt · Zuletzt geändert: 07.02.2017 07:09 von fwolf