WP_Recovery_Mode_Link_Service::handle_begin_link()
Enters recovery mode when the user hits wp-login.php with a valid recovery mode link.
Метод класса: WP_Recovery_Mode_Link_Service{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WP_Recovery_Mode_Link_Service = new WP_Recovery_Mode_Link_Service(); $WP_Recovery_Mode_Link_Service->handle_begin_link( $ttl );
- $ttl(int) (обязательный)
- Number of seconds the link should be valid for.
Заметки
- Global. Строка. $pagenow The filename of the current screen.
Список изменений
С версии 5.2.0 | Введена. |
Код WP_Recovery_Mode_Link_Service::handle_begin_link() WP Recovery Mode Link Service::handle begin link WP 6.6.2
public function handle_begin_link( $ttl ) { if ( ! isset( $GLOBALS['pagenow'] ) || 'wp-login.php' !== $GLOBALS['pagenow'] ) { return; } if ( ! isset( $_GET['action'], $_GET['rm_token'], $_GET['rm_key'] ) || self::LOGIN_ACTION_ENTER !== $_GET['action'] ) { return; } if ( ! function_exists( 'wp_generate_password' ) ) { require_once ABSPATH . WPINC . '/pluggable.php'; } $validated = $this->key_service->validate_recovery_mode_key( $_GET['rm_token'], $_GET['rm_key'], $ttl ); if ( is_wp_error( $validated ) ) { wp_die( $validated, '' ); } $this->cookie_service->set_cookie(); $url = add_query_arg( 'action', self::LOGIN_ACTION_ENTERED, wp_login_url() ); wp_redirect( $url ); die; }