Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: admin_email_check_interval

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
590
591                /**
592                 * 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.
594                 *
595                 * @since 5.3.0
596                 *
597                 * @param int Interval time (in seconds).
598                 */
599                $admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 6 * MONTH_IN_SECONDS );
600
601                if ( $admin_email_check_interval > 0 ) {
602                     update_option( 'admin_email_lifespan', time() + $admin_email_check_interval );
603                }
604
605                wp_safe_redirect( $redirect_to );
606                exit;
607           }
608
 
Line Code
1233                }
1234
1235                // Check if it is time to add a redirect to the admin email confirmation screen.
1236                if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( 'manage_options' ) ) {
1237                     $admin_email_lifespan = (int) get_option( 'admin_email_lifespan' );
1238
1239                     // If `0` (or anything "falsey" as it is cast to int) is returned, the user will not be redirected
1240                     // to the admin email confirmation screen.
1241                     /** This filter is documented in wp-login.php */
1242                     $admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 6 * MONTH_IN_SECONDS );
1243
1244                     if ( $admin_email_check_interval > 0 && time() > $admin_email_lifespan ) {
1245                          $redirect_to = add_query_arg( 'action', 'confirm_admin_email', wp_login_url( $redirect_to ) );
1246                     }
1247                }
1248
1249                if ( ( empty( $redirect_to ) || $redirect_to === 'wp-admin/' || $redirect_to === admin_url() ) ) {
1250                     // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.
1251                     if ( is_multisite() && ! get_active_blog_for_user( $user->ID ) && ! is_super_admin( $user->ID ) ) {