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
This commit is contained in:
parent
adf1792adc
commit
87a759b81c
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
18
wp-login.php
18
wp-login.php
|
@ -581,14 +581,26 @@ switch ( $action ) {
|
||||||
exit;
|
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 ( ! empty( $_GET['remind_me_later'] ) ) {
|
||||||
if ( ! wp_verify_nonce( $_GET['remind_me_later'], 'remind_me_later_nonce' ) ) {
|
if ( ! wp_verify_nonce( $_GET['remind_me_later'], 'remind_me_later_nonce' ) ) {
|
||||||
wp_safe_redirect( wp_login_url() );
|
wp_safe_redirect( wp_login_url() );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// "Remind me later" is a bit ambiguous. Three days later?
|
if ( $remind_interval > 0 ) {
|
||||||
update_option( 'admin_email_lifespan', time() + 3 * DAY_IN_SECONDS );
|
update_option( 'admin_email_lifespan', time() + $remind_interval );
|
||||||
|
}
|
||||||
|
|
||||||
wp_safe_redirect( $redirect_to );
|
wp_safe_redirect( $redirect_to );
|
||||||
exit;
|
exit;
|
||||||
|
@ -695,6 +707,7 @@ switch ( $action ) {
|
||||||
<a class="button button-large" href="<?php echo esc_url( $change_link ); ?>"><?php _e( 'Update' ); ?></a>
|
<a class="button button-large" href="<?php echo esc_url( $change_link ); ?>"><?php _e( 'Update' ); ?></a>
|
||||||
<input type="submit" name="correct-admin-email" id="correct-admin-email" class="button button-primary button-large" value="<?php esc_attr_e( 'The email is correct' ); ?>" />
|
<input type="submit" name="correct-admin-email" id="correct-admin-email" class="button button-primary button-large" value="<?php esc_attr_e( 'The email is correct' ); ?>" />
|
||||||
</div>
|
</div>
|
||||||
|
<?php if ( $remind_interval > 0 ) : ?>
|
||||||
<div class="admin-email__actions-secondary">
|
<div class="admin-email__actions-secondary">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
@ -710,6 +723,7 @@ switch ( $action ) {
|
||||||
?>
|
?>
|
||||||
<a href="<?php echo esc_url( $remind_me_link ); ?>"><?php _e( 'Remind me later' ); ?></a>
|
<a href="<?php echo esc_url( $remind_me_link ); ?>"><?php _e( 'Remind me later' ); ?></a>
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue