Yoast\WP\SEO\MyYoast_Client\User_Interface

OAuth_Callback_Integration::handle │ public │ Yoast 1.0

Handles the OAuth callback request.

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

Хуков нет.

Возвращает

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

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

$OAuth_Callback_Integration = new OAuth_Callback_Integration();
$OAuth_Callback_Integration->handle(): void;

Код OAuth_Callback_Integration::handle() Yoast 28.9

public function handle(): void {
	$user_id    = \get_current_user_id();
	$return_url = $this->resolve_return_url( $user_id );

	// admin_post_* (no _nopriv variant) only fires for logged-in users, so $user_id should
	// always be > 0 here. Defensive check in case the hook is dispatched manually.
	if ( $user_id <= 0 ) {
		$this->redirect_helper->do_safe_redirect( $return_url );
		return;
	}

	// The handler records the outcome for the next page load to surface; this
	// endpoint only needs to send the browser back where the flow started.
	$this->callback_handler->handle(
		$user_id,
		$this->read_query_arg( 'code' ),
		$this->read_query_arg( 'state' ),
		$this->read_query_arg( 'error' ),
	);

	$this->redirect_helper->do_safe_redirect( $return_url );
}