WC_Helper::_helper_auth_disconnect() private WC 1.0
Disconnect from WooCommerce.com, clear OAuth tokens.
{} Это метод класса: WC_Helper{}
Хуки из метода
Возвращает
Null. Ничего.
Использование
$result = WC_Helper::_helper_auth_disconnect();
Код WC_Helper::_helper_auth_disconnect() WC Helper:: helper auth disconnect WC 5.0.0
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 = add_query_arg(
array(
'page' => 'wc-addons',
'section' => 'helper',
'wc-helper-status' => 'helper-disconnected',
),
admin_url( 'admin.php' )
);
WC_Helper_API::post(
'oauth/invalidate_token',
array(
'authenticated' => true,
)
);
WC_Helper_Options::update( 'auth', array() );
WC_Helper_Options::update( 'auth_user_data', array() );
self::_flush_subscriptions_cache();
self::_flush_updates_cache();
wp_safe_redirect( $redirect_uri );
die();
}