From 87a759b81c7a6d7e2ef6a361a55826e46f3c4e21 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 9 Dec 2019 13:26:02 +0000 Subject: [PATCH] Users: Introduce `admin_email_remind_interval` filter for dismissing the admin email confirmation screen. Props desrosj, birgire. Fixes #48334. Built from https://develop.svn.wordpress.org/trunk@46838 git-svn-id: http://core.svn.wordpress.org/trunk@46638 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-login.php | 44 +++++++++++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index be27f7444f..ff22737db6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-46837'; +$wp_version = '5.4-alpha-46838'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-login.php b/wp-login.php index 7c2c5a5a02..f9f25fa3eb 100644 --- a/wp-login.php +++ b/wp-login.php @@ -581,14 +581,26 @@ switch ( $action ) { exit; } + /** + * Filters the interval for dismissing the admin email confirmation screen. + * + * If `0` (zero) is returned, the "Remind me later" link will not be displayed. + * + * @since 5.3.1 + * + * @param int $interval Interval time (in seconds). Default is 3 days. + */ + $remind_interval = (int) apply_filters( 'admin_email_remind_interval', 3 * DAY_IN_SECONDS ); + if ( ! empty( $_GET['remind_me_later'] ) ) { if ( ! wp_verify_nonce( $_GET['remind_me_later'], 'remind_me_later_nonce' ) ) { wp_safe_redirect( wp_login_url() ); exit; } - // "Remind me later" is a bit ambiguous. Three days later? - update_option( 'admin_email_lifespan', time() + 3 * DAY_IN_SECONDS ); + if ( $remind_interval > 0 ) { + update_option( 'admin_email_lifespan', time() + $remind_interval ); + } wp_safe_redirect( $redirect_to ); exit; @@ -695,21 +707,23 @@ switch ( $action ) { -
- 0 ) : ?> +
+ 'confirm_admin_email', - 'remind_me_later' => wp_create_nonce( 'remind_me_later_nonce' ), - ), - $remind_me_link - ); + $remind_me_link = wp_login_url( $redirect_to ); + $remind_me_link = add_query_arg( + array( + 'action' => 'confirm_admin_email', + 'remind_me_later' => wp_create_nonce( 'remind_me_later_nonce' ), + ), + $remind_me_link + ); - ?> - -
+ ?> + +
+