WP_Recovery_Mode::initialize()publicWP 5.2.0

Initialize recovery mode for the current request.

Метод класса: WP_Recovery_Mode{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WP_Recovery_Mode = new WP_Recovery_Mode();
$WP_Recovery_Mode->initialize();

Список изменений

С версии 5.2.0 Введена.

Код WP_Recovery_Mode::initialize() WP 6.4.3

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