Make WordPress Core

Ticket #48153: 48153.4.diff

File 48153.4.diff, 4.0 KB (added by desrosj, 5 years ago)

Minor docblock formatting changes

  • src/wp-login.php

     
    589589                        }
    590590
    591591                        /**
    592                          * Filters the interval for redirecting the user to the admin email confirmation screen.
    593                          * If `0` (zero), or any "falsey" value is returned, the user will not be redirected.
     592                         * Filters the interval for redirecting the user to the admin email verification screen.
     593                         *
     594                         * If `0` or a negative value is returned, the email verification screen will
     595                         * be shown again next time an administrator logs in.
    594596                         *
    595597                         * @since 5.3.0
    596598                         *
     
    598600                         */
    599601                        $admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 6 * MONTH_IN_SECONDS );
    600602
    601                         if ( $admin_email_check_interval > 0 ) {
    602                                 update_option( 'admin_email_lifespan', time() + $admin_email_check_interval );
    603                         }
     603                        update_option( 'admin_email_lifespan', time() + $admin_email_check_interval );
    604604
    605605                        wp_safe_redirect( $redirect_to );
    606606                        exit;
     
    609609                login_header( __( 'Confirm your administration email' ), '', $errors );
    610610
    611611                /**
    612                 * Fires before the admin email confirm form.
    613                 *
    614                 * @since 5.3.0
    615                 *
    616                 * @param WP_Error $errors A `WP_Error` object containing any errors generated by using invalid credentials. Note that the error object may not contain any errors.
    617                 */
     612                 * Fires before the admin email confirm form.
     613                 *
     614                 * @since 5.3.0
     615                 *
     616                 * @param WP_Error $errors A `WP_Error` object containing any errors generated by using invalid credentials. Note that the error object may not contain any errors.
     617                 */
    618618                do_action( 'admin_email_confirm', $errors );
    619619
    620620                ?>
     
    622622                <form class="admin-email-confirm-form" name="admin-email-confirm-form" action="<?php echo esc_url( site_url( 'wp-login.php?action=confirm_admin_email', 'login_post' ) ); ?>" method="post">
    623623                        <?php
    624624                        /**
    625                         * Fires inside the admin-email-confirm-form form tags, before the hidden fields.
    626                         *
    627                         * @since 5.3.0
    628                         */
     625                         * Fires inside the admin-email-confirm-form form tags, before the hidden fields.
     626                         *
     627                         * @since 5.3.0
     628                         */
    629629                        do_action( 'admin_email_confirm_form' );
    630630
    631631                        wp_nonce_field( 'confirm_admin_email', 'confirm_admin_email_nonce' );
     
    12321232                                exit;
    12331233                        }
    12341234
    1235                         /**
    1236                          * Filters the capability required for displaying the admin email check screen.
    1237                          *
    1238                          * @since 5.3.0
    1239                          *
    1240                          * @param string $capability The capability required to display the admin email check screen.
    1241                          */
    1242                         $admin_check_cap = apply_filters( 'admin_email_check_cap', 'manage_options' );
    1243 
    1244                         // Check if it is time to add a redirect to the admin email confirmation screen.
    1245                         if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( $admin_check_cap ) ) {
    1246                                 $admin_email_lifespan = (int) get_option( 'admin_email_lifespan' );
     1235                        // Check if it is time to add a redirect to the admin email verification screen.
     1236                        if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( 'manage_options' ) ) {
     1237                                /**
     1238                                 * Filters whether the user should be redirected to the verification screen. Can also be used
     1239                                 * to disable this functionality completely.
     1240                                 *
     1241                                 * @since 5.3.0
     1242                                 *
     1243                                 * @param bool    True to redirect, false otherwise.
     1244                                 * @param WP_User WP_User object.
     1245                                 */
     1246                                $show_verification = (bool) apply_filters( 'show_admin_email_verification', true, $user );
    12471247
    1248                                 /** This filter is documented in wp-login.php */
    1249                                 $admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 6 * MONTH_IN_SECONDS );
     1248                                if ( $show_verification ) {
     1249                                        $admin_email_lifespan = (int) get_option( 'admin_email_lifespan' );
    12501250
    1251                                 if ( $admin_email_check_interval > 0 && time() > $admin_email_lifespan ) {
    1252                                         $redirect_to = add_query_arg( 'action', 'confirm_admin_email', wp_login_url( $redirect_to ) );
     1251                                        if ( time() > $admin_email_lifespan ) {
     1252                                                $redirect_to = add_query_arg( 'action', 'confirm_admin_email', wp_login_url( $redirect_to ) );
     1253                                        }
    12531254                                }
    12541255                        }
    12551256