WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 631 | /** |
| 632 | * Filters the interval for redirecting the user to the admin email confirmation screen. |
| 633 | * |
| 634 | * If `0` (zero) is returned, the user will not be redirected. |
| 635 | * |
| 636 | * @since 5.3.0 |
| 637 | * |
| 638 | * @param int $interval Interval time (in seconds). Default is 6 months. |
| 639 | */ |
| 640 | $admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 6 * MONTH_IN_SECONDS ); |
| 641 | |
| 642 | if ( $admin_email_check_interval > 0 ) { |
| 643 | update_option( 'admin_email_lifespan', time() + $admin_email_check_interval ); |
| 644 | } |
| 645 | |
| 646 | wp_safe_redirect( $redirect_to ); |
| 647 | exit; |
| 648 | } |
| 649 | |
| Line | Code |
| 1310 | } |
| 1311 | |
| 1312 | // Check if it is time to add a redirect to the admin email confirmation screen. |
| 1313 | if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( 'manage_options' ) ) { |
| 1314 | $admin_email_lifespan = (int) get_option( 'admin_email_lifespan' ); |
| 1315 | |
| 1316 | // If `0` (or anything "falsey" as it is cast to int) is returned, the user will not be redirected |
| 1317 | // to the admin email confirmation screen. |
| 1318 | /** This filter is documented in wp-login.php */ |
| 1319 | $admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 6 * MONTH_IN_SECONDS ); |
| 1320 | |
| 1321 | if ( $admin_email_check_interval > 0 && time() > $admin_email_lifespan ) { |
| 1322 | $redirect_to = add_query_arg( |
| 1323 | array( |
| 1324 | 'action' => 'confirm_admin_email', |
| 1325 | 'wp_lang' => get_user_locale( $user ), |
| 1326 | ), |
| 1327 | wp_login_url( $redirect_to ) |
| 1328 | ); |