Active_Campaign_Helpers::__construct()

Active_Campaign_helpers constructor.


Source Source

File: src/integrations/active-campaign/helpers/active-campaign-helpers.php

	public function __construct() {

		$this->load_options = Automator()->helpers->recipe->maybe_load_trigger_options( __CLASS__ );

		$this->prefix          = 'AC_ANNON_ADD';
		$this->ac_endpoint_uri = AUTOMATOR_API_URL . 'v2/active-campaign';

		// Allow overwrite in wp-config.php.
		if ( DEFINED( 'UO_AUTOMATOR_DEV_AC_ENDPOINT_URL' ) ) {
			$this->ac_endpoint_uri = UO_AUTOMATOR_DEV_AC_ENDPOINT_URL;
		}

		$this->setting_tab   = 'active-campaign';
		$this->automator_api = AUTOMATOR_API_URL . 'v2/active-campaign';

		add_filter( 'automator_settings_tabs', array( $this, 'add_active_campaign_api_settings' ), 15 );
		add_filter( 'automator_after_settings_extra_buttons', array( $this, 'ac_connect_html' ), 10, 3 );

		// Add the ajax endpoints.
		add_action( 'wp_ajax_active-campaign-list-tags', array( $this, 'list_tags' ) );
		add_action( 'wp_ajax_active-campaign-list-contacts', array( $this, 'list_contacts' ) );
		add_action( 'wp_ajax_active-campaign-list-retrieve', array( $this, 'list_retrieve' ) );
		add_action( 'wp_ajax_active-campaign-disconnect', array( $this, 'disconnect' ) );
		add_action( 'admin_init', array( $this, 'save_settings' ) );

	}