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.
 


git-svn-id: https://develop.svn.wordpress.org/trunk@48359 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jake Spurlock 2020-07-07 03:57:17 +00:00
parent 0dcbb5b02d
commit f86dd5c6ce
3 changed files with 31 additions and 0 deletions

View File

@ -114,6 +114,35 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<div class="wrap">
<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
if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
$classes = 'welcome-panel';

View File

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

View File

@ -617,6 +617,7 @@ switch ( $action ) {
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 );
exit;
}