WC_Helper::_helper_auth_disconnect()private staticWC 1.0

Disconnect from Woo.com, clear OAuth tokens.

Method of the class: WC_Helper{}

Hooks from the method

Return

null. Nothing (null).

Usage

$result = WC_Helper::_helper_auth_disconnect();

WC_Helper::_helper_auth_disconnect() code WC 8.6.1

private static function _helper_auth_disconnect() {
	if ( empty( $_GET['wc-helper-nonce'] ) || ! wp_verify_nonce( wp_unslash( $_GET['wc-helper-nonce'] ), 'disconnect' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
		self::log( 'Could not verify nonce in _helper_auth_disconnect' );
		wp_die( 'Could not verify nonce' );
	}

	/**
	 * Fires when the Helper has been disconnected.
	 */
	do_action( 'woocommerce_helper_disconnected' );

	$redirect_uri = self::get_helper_redirect_url(
		array(
			'page'             => 'wc-addons',
			'section'          => 'helper',
			'wc-helper-status' => 'helper-disconnected',
		)
	);

	self::disconnect();

	wp_safe_redirect( $redirect_uri );
	die();
}