-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtalentlms.php
executable file
·56 lines (50 loc) · 1.54 KB
/
talentlms.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
<?php
/*
Plugin Name: TalentLMS
Plugin URI: http://wordpress.org/extend/plugins/talentlms/
Description: This plugin integrates TalentLMS with WordPress. Promote your TalentLMS content through your WordPress site.
Version: 7.1
Author: Epignosis LLC
Author URI: www.epignosishq.com
License: GPL2
*/
/**
* Require once the Composer Autoload
*/
if (file_exists(plugin_dir_path(__FILE__) . 'vendor/autoload.php')) {
require_once plugin_dir_path(__FILE__) . 'vendor/autoload.php';
}
/**
* Define constants
*/
define('TLMS_BASEPATH', dirname(__FILE__));
define('TLMS_BASEURL', plugin_dir_url(__FILE__));
define('TLMS_VERSION', '7.1');
define('TLMS_UPLOAD_DIR', 'talentlmswpplugin');
/**
* The code that runs during plugin activation
*/
function activate(): void
{
TalentlmsIntegration\Activate::tlms_activate();
}
register_activation_hook(__FILE__, 'activate');
register_uninstall_hook(__FILE__, 'tlms_uninstall');
if (file_exists(TLMS_BASEPATH . '/TalentLMSLib/lib/TalentLMS.php')) {
require_once TLMS_BASEPATH . '/TalentLMSLib/lib/TalentLMS.php';
}
if (class_exists('TalentlmsIntegration\Plugin')) {
TalentlmsIntegration\Plugin::init();
}
function tlms_isWoocommerceActive()
{
if (is_plugin_active('woocommerce/woocommerce.php')) {
update_option('tlms-woocommerce-active', 1);
} else {
update_option('tlms-woocommerce-active', 0);
}
if (empty(get_option('tlms-enroll-user-to-courses'))) {
update_option('tlms-enroll-user-to-courses', 'submission');
}
}
add_action('admin_init', 'tlms_isWoocommerceActive');