Make WordPress Core


Ignore:
Timestamp:
07/07/2020 03:57:17 AM (4 years ago)
Author:
whyisjake
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/_index.php

    r47862 r48359  
    115115    <h1><?php echo esc_html( $title ); ?></h1>
    116116
     117    <?php
     118    if ( ! empty( $_GET['admin_email_remind_later'] ) ) :
     119        /** This filter is documented in wp-login.php */
     120        $remind_interval = (int) apply_filters( 'admin_email_remind_interval', 3 * DAY_IN_SECONDS );
     121        $postponed_time  = get_option( 'admin_email_lifespan' );
     122
     123        /*
     124         * Calculate how many seconds it's been since the reminder was postponed.
     125         * This allows us to not show it if the query arg is set, but visited due to caches, bookmarks or similar.
     126         */
     127        $time_passed = $postponed_time - $remind_interval - time();
     128
     129        // Only show the dashboard notice if it's been less than a minute since the message was postponed.
     130        if ( $time_passed > -60 ) :
     131            ?>
     132        <div class="notice notice-success is-dismissible">
     133            <p>
     134                <?php
     135                printf(
     136                    /* translators: %1$s: The number of comments. %2$s: The post title. */
     137                    _n( 'The admin email verification page will reappear after %d day.', 'The admin email verification page will reappear after %d days.', 3 ),
     138                    number_format_i18n( 3 )
     139                );
     140                ?>
     141            </p>
     142        </div>
     143        <?php endif; ?>
     144    <?php endif; ?>
     145
    117146<?php
    118147if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
Note: See TracChangeset for help on using the changeset viewer.