-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcron.php
55 lines (37 loc) · 1.63 KB
/
cron.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
<?php
require_once "../../../wp-load.php";
set_time_limit(300);
global $wpdb;
$post_table = $wpdb->prefix . "posts";
$postmeta_table = $wpdb->prefix . "postmeta";
$table_name = $wpdb->prefix . "api_credential";
$table_name1 = $wpdb->prefix . "term_taxonomy";
$table_name2 = $wpdb->prefix . "terms";
$adept_access_token_value = get_option('adept_access_token');
$adept_api_url_value = get_option('adept_api_url');
$adept_account_id_value = get_option('adept_account_id');
//importing courses categories
$url = $adept_api_url_value . 'course_categories?access_token=' . $adept_access_token_value . '&account_id=' . $adept_account_id_value;
cron_check_is_authenticated($url);
$result = $adept->import_category($url);
if ($result) {
echo $result;
} else {
echo 'Categories category imported successfully (time: '.clc().')<br><br>';
}
//importing courses
$url = $adept_api_url_value . 'courses?access_token=' . $adept_access_token_value . '&account_id=' . $adept_account_id_value;
$result = $adept->import_course($url);
echo 'Course imported successfully (time: '.clc().')<br><br>';
/*
//importing groups
$url = $adept_api_url_value . 'groups?access_token=' . $adept_access_token_value . '&account_id=' . $adept_account_id_value;
$result = $adept->import_groups($url);
$success = $result;
echo 'class group imported successfully (time: '.clc().')<br><br>';
*/
//importing instructors
$url = $adept_api_url_value . 'team_members?access_token=' . $adept_access_token_value . '&account_id=' . $adept_account_id_value;
$result = $adept->import_instructors($url);
$success = $result;
echo 'instructor updated successfully (time: '.clc().')<br><br>';