Mailchimp_Helpers::uo_mailchimp_disconnect()

Disconnect the user. Remove access token from db, etc.

Contents


Return Return

(void)


Source Source

File: src/integrations/mailchimp/helpers/mailchimp-helpers.php

	public function uo_mailchimp_disconnect() {
		if ( wp_verify_nonce( filter_input( INPUT_GET, 'nonce', FILTER_SANITIZE_STRING ), 'uo-mailchimp-disconnect' ) ) {
			delete_option( '_uncannyowl_mailchimp_settings' );
			delete_option( '_uncannyowl_mailchimp_settings_expired' );
			delete_option( '_uncannyowl_mailchimp_settings_user_info' );
			delete_transient( 'automator_api_mailchimp_authorize_nonce' );
			delete_transient( '_uncannyowl_mailchimp_settings' );
		}
		wp_safe_redirect(
			add_query_arg(
				array(
					'post_type' => 'uo-recipe',
					'page'      => 'uncanny-automator-settings',
					'tab'       => 'mailchimp_api',
				),
				admin_url( 'edit.php' )
			)
		);
		exit;
	}