Automattic\WooCommerce\Blocks\AI

Configuration::register_and_connect()privateWC 1.0

Register the site with Jetpack.

Method of the class: Configuration{}

No Hooks.

Return

true|false|\WP_Error.

Usage

// private - for code of main (parent) class only
$result = $this->register_and_connect();

Configuration::register_and_connect() code WC 9.0.1

private function register_and_connect() {
	Utils::init_default_constants();

	$jetpack_id     = \Jetpack_Options::get_option( 'id' );
	$jetpack_public = \Jetpack_Options::get_option( 'public' );

	$register = $jetpack_id && $jetpack_public ? true : $this->manager->register();

	if ( true === $register && ! $this->manager->is_user_connected() ) {
		$this->manager->connect_user();
		return true;
	}

	return false;
}