[英]How to change Idle time on the Wordpress admin dashboard?
I have a fresh installation of Wordpress 5.9, I installed the WPVivid plugin to restore from backup.我全新安装了 Wordpress 5.9,我安装了 WPVivid 插件以从备份中恢复。 However, the restoration process seems to take more than 15 mins but wordpress keeps logging me out with a popup message that says "session expired".然而,恢复过程似乎需要超过 15 分钟,但 wordpress 不断让我退出并显示“会话已过期”的弹出消息。 How do I change that?, or maybe increase the idle timeout?我该如何改变它?,或者可能增加空闲超时?
you can use this code it您可以使用此代码
add_filter('auth_cookie_expiration', 'ak_function', 99, 3);
function ak_function($seconds, $user_id, $sesstiontime){
if ( $sesstiontime) {
$expiration = 14*24*60*60;
} else {
$expiration = 2*24*60*60; //UPDATE HERE;
}
if ( PHP_INT_MAX - time() < $expiration ) {
$expiration = PHP_INT_MAX - time() - 5;
}
return $expiration;
}
or或者
add_filter( 'auth_cookie_expiration', 'keep_me_logged_in_for_1_year' );
function keep_me_logged_in_for_1_year( $expirein ) {
return YEAR_IN_SECONDS; // 1 year in seconds
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.