WP_Recovery_Mode::initialize() public WP 5.2.0
Initialize recovery mode for the current request.
{} It's a method of the class: WP_Recovery_Mode{}
No Hooks.
Return
Null. Nothing.
Usage
$WP_Recovery_Mode = new WP_Recovery_Mode(); $WP_Recovery_Mode->initialize();
Changelog
Since 5.2.0 | Introduced. |
Code of WP_Recovery_Mode::initialize() WP Recovery Mode::initialize WP 5.6
public function initialize() {
$this->is_initialized = true;
add_action( 'wp_logout', array( $this, 'exit_recovery_mode' ) );
add_action( 'login_form_' . self::EXIT_ACTION, array( $this, 'handle_exit_recovery_mode' ) );
add_action( 'recovery_mode_clean_expired_keys', array( $this, 'clean_expired_keys' ) );
if ( ! wp_next_scheduled( 'recovery_mode_clean_expired_keys' ) && ! wp_installing() ) {
wp_schedule_event( time(), 'daily', 'recovery_mode_clean_expired_keys' );
}
if ( defined( 'WP_RECOVERY_MODE_SESSION_ID' ) ) {
$this->is_active = true;
$this->session_id = WP_RECOVERY_MODE_SESSION_ID;
return;
}
if ( $this->cookie_service->is_cookie_set() ) {
$this->handle_cookie();
return;
}
$this->link_service->handle_begin_link( $this->get_link_ttl() );
}