WP_Recovery_Mode::initialize()

In this article

Initialize recovery mode for the current request.

Source

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() );
}

Changelog

VersionDescription
5.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.