Yoast\WP\SEO\MyYoast_Client\Application

OAuth_Callback_Handler::handlepublicYoast 1.0

Handles an OAuth authorization-code callback.

The outcome is persisted for the user (except for a no-op, which is not a real callback) so a later page load can surface it once, and also returned for the caller to act on immediately.

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

Хуков нет.

Возвращает

Callback_Outcome. The outcome of the callback.

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

$OAuth_Callback_Handler = new OAuth_Callback_Handler();
$OAuth_Callback_Handler->handle( $user_id, $code, $state, $error ): Callback_Outcome;
$user_id(int) (обязательный)
The WordPress user ID the flow belongs to.
$code(строка) (обязательный)
The authorization code from the callback (empty if absent).
$state(строка) (обязательный)
The state parameter from the callback (empty if absent).
$error(строка) (обязательный)
The provider error code from the callback (empty if none).

Код OAuth_Callback_Handler::handle() Yoast 28.3

public function handle( int $user_id, string $code, string $state, string $error ): Callback_Outcome {
	$outcome = $this->resolve( $user_id, $code, $state, $error );

	if ( ! $outcome->is_no_op() && $user_id > 0 ) {
		$this->expiring_store->persist_for_user(
			self::OUTCOME_KEY,
			$outcome->to_array(),
			self::OUTCOME_TTL,
			$user_id,
		);
	}

	return $outcome;
}