Make WordPress Core

Ticket #48153: 48153.diff

File 48153.diff, 1.5 KB (added by desrosj, 5 years ago)
  • src/wp-login.php

     
    590590
    591591                        /**
    592592                         * Filters the interval for redirecting the user to the admin email confirmation screen.
    593                          * If `0` (zero) is returned, the user will not be redirected.
     593                         * If `0` (zero) (or any :falsey" value( is returned, the user will not be redirected.
    594594                         *
    595595                         * @since 5.3.0
    596596                         *
     
    12301230                                exit;
    12311231                        }
    12321232
     1233                        /**
     1234                         * Filters the capability required for displaying the admin email check screen.
     1235                         *
     1236                         * @since 5.3.0
     1237                         *
     1238                         * @param string $capability The capability required to display the admn email check screen.
     1239                         */
     1240                        $admin_check_cap = apply_filters( 'admin_email_check_cap', 'manage_options' );
     1241
    12331242                        // Check if it is time to add a redirect to the admin email confirmation screen.
    1234                         if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( 'manage_options' ) ) {
     1243                        if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( $admin_check_cap ) ) {
    12351244                                $admin_email_lifespan = (int) get_option( 'admin_email_lifespan' );
    12361245
    1237                                 // If `0` (or anything "falsey" as it is cast to int) is returned, the user will not be redirected
    1238                                 // to the admin email confirmation screen.
    12391246                                /** This filter is documented in wp-login.php */
    12401247                                $admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 6 * MONTH_IN_SECONDS );
    12411248