Facebook_Groups_Helpers::__construct()


Source Source

File: src/integrations/facebook-groups/helpers/facebook-groups-helpers.php

	public function __construct() {

		// Capturing the OAuth Token and user id.
		add_action( 'wp_ajax_' . self::AJAX_PREFIX, array( $this, self::AJAX_PREFIX ), 10 );

		// Add a disconnect button.
		add_action( 'wp_ajax_' . self::AJAX_PREFIX . '_disconnect', array( $this, self::AJAX_PREFIX . '_disconnect' ) );

		// Add an ajax endpoint for listing groups.
		add_action( 'wp_ajax_ua_facebook_group_list_groups', array( $this, 'list_groups' ) );

		// Check if token is still valid or not.
		add_action( 'admin_init', array( $this, 'maybe_add_admin_notice' ) );

		require_once __DIR__ . '/../settings/settings-facebook-groups.php';

		new Facebook_Group_Settings( $this );

	}