-
Notifications
You must be signed in to change notification settings - Fork 0
/
edd-segment-io.php
68 lines (59 loc) · 1.54 KB
/
edd-segment-io.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
* @package EDD_Segment
* @version 1.2
*/
/*
* Plugin Name: EDD Segment
* Plugin URI: https://sproutapps.co/edd-segment/
* Description: Hooks up your EDD run site with Segment and/or Customer.io. Learn more at <a href="https://sproutapps.co/edd-segment-io">Sprout Apps</a>.
* Author: Sprout Apps
* Version: 1.2
* Author URI: https://sproutapps.co
* Text Domain: sprout-apps
* Domain Path: languages
*/
/**
* SI directory
*/
define( 'EDD_SEGMENT_PATH', WP_PLUGIN_DIR . '/' . basename( dirname( __FILE__ ) ) );
/**
* Plugin File
*/
define( 'EDD_SEGMENT_PLUGIN_FILE', __FILE__ );
/**
* SI URL
*/
define( 'EDD_SEGMENT_URL', plugins_url( '', __FILE__ ) );
/**
* URL to resources directory
*/
define( 'EDD_SEGMENT_RESOURCES', plugins_url( 'resources/', __FILE__ ) );
/**
* Load plugin
*/
require_once EDD_SEGMENT_PATH . '/load.php';
/**
* do_action when plugin is activated.
* @package EDD_Segment
* @ignore
*/
register_activation_hook( __FILE__, 'edd_segment_plugin_activated' );
function edd_segment_plugin_activated() {
do_action( 'edd_segment_plugin_activation_hook' );
}
/**
* do_action when plugin is deactivated.
* @package EDD_Segment
* @ignore
*/
register_deactivation_hook( __FILE__, 'edd_segment_plugin_deactivated' );
function edd_segment_plugin_deactivated() {
do_action( 'edd_segment_plugin_deactivation_hook' );
}
function edd_segment_deactivate_plugin() {
if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
require_once ABSPATH.'/wp-admin/includes/plugin.php';
deactivate_plugins( __FILE__ );
}
}