Site Health: Ensure that the user will be notified after a successful snooze action.

After clicking remind me later, the user is shown an admin notification.

Fixes #48333.

Props desrosj, sathyapulse, Clorith, azaozz, audrasjb, afragen, whyisjake.
 

Built from https://develop.svn.wordpress.org/trunk@48359


git-svn-id: http://core.svn.wordpress.org/trunk@48128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
whyisjake 2020-07-07 03:59:02 +00:00
parent 6542769c56
commit aad1fa48ea
4 changed files with 32 additions and 1 deletions

View File

@ -114,6 +114,35 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<div class="wrap"> <div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1> <h1><?php echo esc_html( $title ); ?></h1>
<?php
if ( ! empty( $_GET['admin_email_remind_later'] ) ) :
/** This filter is documented in wp-login.php */
$remind_interval = (int) apply_filters( 'admin_email_remind_interval', 3 * DAY_IN_SECONDS );
$postponed_time = get_option( 'admin_email_lifespan' );
/*
* Calculate how many seconds it's been since the reminder was postponed.
* This allows us to not show it if the query arg is set, but visited due to caches, bookmarks or similar.
*/
$time_passed = $postponed_time - $remind_interval - time();
// Only show the dashboard notice if it's been less than a minute since the message was postponed.
if ( $time_passed > -60 ) :
?>
<div class="notice notice-success is-dismissible">
<p>
<?php
printf(
/* translators: %1$s: The number of comments. %2$s: The post title. */
_n( 'The admin email verification page will reappear after %d day.', 'The admin email verification page will reappear after %d days.', 3 ),
number_format_i18n( 3 )
);
?>
</p>
</div>
<?php endif; ?>
<?php endif; ?>
<?php <?php
if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) : if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
$classes = 'welcome-panel'; $classes = 'welcome-panel';

View File

@ -1181,6 +1181,7 @@ function wp_removable_query_args() {
$removable_query_args = array( $removable_query_args = array(
'activate', 'activate',
'activated', 'activated',
'admin_email_remind_later',
'approved', 'approved',
'deactivate', 'deactivate',
'delete_count', 'delete_count',

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.5-alpha-48358'; $wp_version = '5.5-alpha-48359';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -617,6 +617,7 @@ switch ( $action ) {
update_option( 'admin_email_lifespan', time() + $remind_interval ); update_option( 'admin_email_lifespan', time() + $remind_interval );
} }
$redirect_to = add_query_arg( 'admin_email_remind_later', 1, $redirect_to );
wp_safe_redirect( $redirect_to ); wp_safe_redirect( $redirect_to );
exit; exit;
} }