此新功能是在core ticket的5.3中添加的#46349
目前(在5.3中)我们有 [src] 在里面wp-login.php
:
/**
* Filters the interval for redirecting the user to the admin email confirmation screen.
* If `0` (zero) is returned, the user will not be redirected.
*
* @since 5.3.0
*
* @param int Interval time (in seconds).
*/
$admin_email_check_interval = (int) apply_filters( \'admin_email_check_interval\', 6 * MONTH_IN_SECONDS );
if ( $admin_email_check_interval > 0 ) {
update_option( \'admin_email_lifespan\', time() + $admin_email_check_interval );
}
wp_safe_redirect( $redirect_to );
exit;
还有逻辑[
src]:
$admin_email_lifespan = (int) get_option( \'admin_email_lifespan\' );
// If `0` (or anything "falsey" as it is cast to int) is returned, the user will not be redirected
// to the admin email confirmation screen.
/** This filter is documented in wp-login.php */
$admin_email_check_interval = (int) apply_filters( \'admin_email_check_interval\', 6 * MONTH_IN_SECONDS );
if ( $admin_email_check_interval > 0 && time() > $admin_email_lifespan ) {
$redirect_to = add_query_arg( \'action\', \'confirm_admin_email\', wp_login_url( $redirect_to ) );
}
因此,我们可以通过使用(必须使用)插件将管理员电子邮件检查间隔过滤为零来禁用屏幕,如:
<?php /** Plugin Name: WPSE-353167: Disable Admin Email Checking Screen **/
add_filter( \'admin_email_check_interval\', \'__return_zero\' );
在这里
__return_zero()
是一个核心
helper function 返回零整数。我们还可以在转换为整数时返回不大于零的值(例如。
false
,
null
,
\'0\'
, ... ).
还有一张公开票#48153 使其在功能筛选方面更加灵活。
以下是已发布的dev notes.