Instagram_Helpers::__construct()


Source Source

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

	public function __construct() {

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

		$this->setting_tab = 'instagram_api';

		$this->fb_endpoint_uri = AUTOMATOR_API_URL . 'v2/facebook';

		$this->wp_ajax_action = 'automator_integration_instagram_capture_token';

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

		// Adds new section to tab.
		add_filter( 'automator_settings_tabs', array( $this, 'add_instagram_api_settings' ), 15 );

		// Add a fetch user pages action.
		add_action( "wp_ajax_{$this->wp_ajax_action}_fetch_user_pages", array( $this, sprintf( '%s_fetch_user_pages', $this->wp_ajax_action ) ) );

		// Add get instagram action.
		add_action( "wp_ajax_{$this->wp_ajax_action}_fetch_instagram_accounts", array( $this, sprintf( '%s_fetch_instagram_accounts', $this->wp_ajax_action ) ) );

	}