Add_Google_Sheet_Integration::add_integration_func()

Register the integration by pushing it into the global automator object


Source Source

File: src/integrations/google-sheet/add-google-sheet-integration.php

	public function add_integration_func() {

		global $uncanny_automator;

		$gtw_options = get_option( '_uncannyowl_google_sheet_settings', array() );

		if ( isset( $gtw_options['refresh_token'] ) && ! empty( $gtw_options['refresh_token'] ) ) {
			$this->connected   = true;
		}

		$uncanny_automator->register->integration(
			self::$integration,
			array(
				'name'         => 'Google Sheets',
				'connected'    => $this->connected,
				'icon_svg'     => Utilities::automator_get_integration_icon( __DIR__ . '/img/google-sheet-icon.svg' ),
				'settings_url' => admin_url( 'edit.php' ) . '?post_type=uo-recipe&page=uncanny-automator-settings&tab=googlesheets_api'
			)
		);

	}