コード例 #1
0
ファイル: Segment_API.php プロジェクト: SproutApps/segment-io
 public static function init()
 {
     self::$write_key = EDD_Segment_Settings::get_write_key();
     if (self::$write_key) {
         add_action('edd_segment_identify', array(__CLASS__, 'identify'), 10, 2);
         add_action('edd_segment_track', array(__CLASS__, 'track'), 10, 3);
     }
 }
コード例 #2
0
ファイル: Settings.php プロジェクト: SproutApps/segment-io
 public static function init()
 {
     // Store options
     self::$write_key = get_option(self::SEGMENT_WRITE_KEY, '');
     self::$customerio_api = get_option(self::CUSTOMERIO_API_KEY, '');
     self::$customerio_site_id = get_option(self::CUSTOMERIO_SITE_ID, '');
     // Register Settings
     self::register_settings();
 }
コード例 #3
0
 public static function init()
 {
     self::$site_id = EDD_Segment_Settings::get_customerio_site_id();
     self::$api_key = EDD_Segment_Settings::get_customerio_api();
     // Main Tracker
     add_action('wp_head', array(__CLASS__, 'add_tracker_code'));
     // Event tracker script
     add_action('cio_js_track', array(__CLASS__, 'js_track'), 0, 2);
     // Action hooks for add-ons, e.g. EDD_Hooks
     add_action('edd_segment_identify', array(__CLASS__, 'identify'), 10, 2);
     add_action('edd_segment_track', array(__CLASS__, 'track'), 10, 3);
     add_action('edd_segment_uid_stored', array(__CLASS__, 'maybe_store_uid'));
 }
コード例 #4
0
ファイル: load.php プロジェクト: SproutApps/segment-io
/**
 * Load the SI application
 * (function called at the bottom of this page)
 *
 * @package EDD_Segment
 * @return void
 */
function edd_segment_load()
{
    if (class_exists('EDD_Segment')) {
        edd_segment_deactivate_plugin();
        return;
        // already loaded, or a name collision
    }
    do_action('edd_segment_preload');
    //////////
    // Load //
    //////////
    // Master class
    require_once EDD_SEGMENT_PATH . '/Segment.php';
    // controllers
    require_once EDD_SEGMENT_PATH . '/controllers/_Controller.php';
    EDD_Segment_Controller::init();
    if (!class_exists('SA_Settings_API')) {
        require_once EDD_SEGMENT_PATH . '/controllers/_Settings.php';
        SA_Settings_API::init();
    }
    require_once EDD_SEGMENT_PATH . '/controllers/Settings.php';
    EDD_Segment_Settings::init();
    require_once EDD_SEGMENT_PATH . '/controllers/Identity.php';
    EDD_Segment_Identity::init();
    require_once EDD_SEGMENT_PATH . '/controllers/integrations/Segment_API.php';
    EDD_Segment_Tracker::init();
    require_once EDD_SEGMENT_PATH . '/controllers/integrations/CustomerIO_API.php';
    EDD_CustomerIO_Tracker::init();
    if (file_exists(EDD_SEGMENT_PATH . '/controllers/add-ons/AJAX_Callbacks.php')) {
        require_once EDD_SEGMENT_PATH . '/controllers/add-ons/AJAX_Callbacks.php';
        EDD_Segment_AJAX_Callbacks::init();
    }
    if (file_exists(EDD_SEGMENT_PATH . '/controllers/add-ons/Freemius_Webhook.php')) {
        require_once EDD_SEGMENT_PATH . '/controllers/add-ons/Freemius_Webhook.php';
        EDD_Segment_Freemius_Webhook::init();
    }
    require_once EDD_SEGMENT_PATH . '/controllers/add-ons/EDD_Hooks.php';
    EDD_Segment_Hooks::init();
    require_once EDD_SEGMENT_PATH . '/controllers/Updates.php';
    EDD_Segment_Updates::init();
    require_once EDD_SEGMENT_PATH . '/template-tags/edd-segment.php';
    do_action('edd_segment_loaded');
}