Yoast\WP\SEO\MyYoast_Client\User_Interface

OAuth_Callback_Integration::resolve_return_urlprivateYoast 1.0

Resolves the URL to send the browser back to after the callback runs.

Falls back to the integrations page when no return URL is stored (stale bookmark, no pending flow).

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

Хуков нет.

Возвращает

Строку. The return URL.

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

// private - только в коде основоного (родительского) класса
$result = $this->resolve_return_url( $user_id ): string;
$user_id(int) (обязательный)
The WordPress user ID.

Код OAuth_Callback_Integration::resolve_return_url() Yoast 28.3

private function resolve_return_url( int $user_id ): string {
	$fallback = \admin_url( 'admin.php?page=' . General_Page_Integration::PAGE );

	if ( $user_id > 0 ) {
		$stored = $this->auth_code_handler->get_return_url( $user_id );
		if ( \is_string( $stored ) && $stored !== '' ) {
			// Defense in depth: the stored URL is only ever written as an
			// admin_url by the management route, but validate it against the
			// site's own host before redirecting so a tampered store entry
			// can't become an open redirect.
			return \wp_validate_redirect( $stored, $fallback );
		}
	}

	return $fallback;
}