WC_Helper_Admin::get_connection_url()public staticWC 1.0

Generates the URL for connecting or disconnecting the store to/from WooCommerce.com. Approach taken from existing helper code that isn't exposed.

Method of the class: WC_Helper_Admin{}

No Hooks.

Return

String.

Usage

$result = WC_Helper_Admin::get_connection_url();

WC_Helper_Admin::get_connection_url() code WC 8.9.0

public static function get_connection_url() {
	global $current_screen;

	$connect_url_args = array(
		'page'    => 'wc-addons',
		'section' => 'helper',
	);

	// No active connection.
	if ( WC_Helper::is_site_connected() ) {
		$connect_url_args['wc-helper-disconnect'] = 1;
		$connect_url_args['wc-helper-nonce']      = wp_create_nonce( 'disconnect' );
	} else {
		$connect_url_args['wc-helper-connect'] = 1;
		$connect_url_args['wc-helper-nonce']   = wp_create_nonce( 'connect' );
	}

	return add_query_arg(
		$connect_url_args,
		admin_url( 'admin.php' )
	);
}