logout_redirect
Filters the log out redirect URL.
Использование
add_filter( 'logout_redirect', 'wp_kama_logout_redirect_filter', 10, 3 ); /** * Function for `logout_redirect` filter-hook. * * @param string $redirect_to The redirect destination URL. * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter. * @param WP_User $user The WP_User object for the user that's logging out. * * @return string */ function wp_kama_logout_redirect_filter( $redirect_to, $requested_redirect_to, $user ){ // filter... return $redirect_to; }
- $redirect_to(строка)
- The redirect destination URL.
- $requested_redirect_to(строка)
- The requested redirect destination URL passed as a parameter.
- $user(WP_User)
- The WP_User object for the user that's logging out.
Список изменений
С версии 4.2.0 | Введена. |
Где вызывается хук
В файле: /wp-login.php
logout_redirect
wp-login.php 823
$redirect_to = apply_filters( 'logout_redirect', $redirect_to, $requested_redirect_to, $user );