WPCF7_Service_OAuth2::load()publicCF7 1.0

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

Хуков нет.

Возвращает

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

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

$WPCF7_Service_OAuth2 = new WPCF7_Service_OAuth2();
$WPCF7_Service_OAuth2->load( $action );
$action **
-
По умолчанию: ''

Код WPCF7_Service_OAuth2::load() CF7 5.9.3

public function load( $action = '' ) {
	if ( 'auth_redirect' === $action ) {
		$code = $_GET['code'] ?? '';

		if ( $code ) {
			$this->request_token( $code );
		}

		if ( ! empty( $this->access_token ) ) {
			$message = 'success';
		} else {
			$message = 'failed';
		}

		wp_safe_redirect( $this->menu_page_url(
			array(
				'action' => 'setup',
				'message' => $message,
			)
		) );

		exit();
	}
}