Skip to content

Commit

Permalink
Site Health: Allow the capability required for the site admin email v…
Browse files Browse the repository at this point in the history
…erification screen to be filtered.

Props desrosj, Clorith.
Fixes #48153.

git-svn-id: https://develop.svn.wordpress.org/trunk@46323 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
desrosj committed Sep 26, 2019
1 parent 1c9f3e0 commit d8337e1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/wp-login.php
Original file line number Diff line number Diff line change
Expand Up @@ -1230,8 +1230,17 @@ function retrieve_password() {
exit;
}

/**
* Filters the capability required for displaying the admin email check screen.
*
* @since 5.3.0
*
* @param string $capability The capability required to display the admn email check screen.
*/
$admin_check_cap = apply_filters( 'admin_email_check_cap', 'manage_options' );

// Check if it is time to add a redirect to the admin email confirmation screen.
if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( 'manage_options' ) ) {
if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( $admin_check_cap ) ) {
$admin_email_lifespan = (int) get_option( 'admin_email_lifespan' );

// If `0` (or anything "falsey" as it is cast to int) is returned, the user will not be redirected
Expand Down

0 comments on commit d8337e1

Please sign in to comment.