<?php include_once MY_PLUGIN_PATH . "lib/lib.php"; $adept = new WP_Lib(); $wp_adept_lms = new WP_Adept_LMS(); $plugin1 = 'sitepress-multilingual-cms/sitepress.php'; $plugin2 = 'wpml-translation-management/plugin.php'; //if(is_plugin_active($plugin1) && is_plugin_active($plugin2)){ if (isset($_POST['save_code'])) { if ($_POST) { /*if (trim($_POST['api_url']) == '') { $error = 'Please enter API URL'; } else { $url = $_POST['api_url']; }*/ if (trim($_POST['email']) == '') { $error = 'Please enter email'; } else { $email = $_POST['email']; } if (trim($_POST['password']) == '') { $error = 'Please enter password'; } else { $password = $_POST['password']; } if (trim($_POST['account_id']) == '') { $error = 'Please enter Account Id'; } else { $account_id = $_POST['account_id']; } if (trim($_POST['author']) == '') {
<?php $wp_adept_lms = new WP_Adept_LMS(); include_once MY_PLUGIN_PATH . "lib/lib.php"; $adept = new WP_Lib(); 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'); $langdata = $adept->get_languages(); $default_language = $langdata->default_language; //course unpublish code if (isset($_POST['unpublish_courses'])) { if ($adept_access_token_value == '') { $error = "Please enter authentication detail"; } else { $url = $adept_api_url_value . 'unpublished_courses?access_token=' . $adept_access_token_value . '&account_id=' . $adept_account_id_value; $result = $adept->unpublished_courses($url); $success = $result; }} if (isset($_POST['import_categories'])) { if ($adept_access_token_value == '') { $error = "Please enter authentication detail"; } else { $url = $adept_api_url_value . 'course_categories?access_token=' . $adept_access_token_value . '&account_id=' . $adept_account_id_value; $result = $adept->import_category($url); if ($result) { $error = $result; } else { $success = 'Course category imported successfully'; } } } //course import code