function do_export() { $lms = !empty($_POST['lsm_export']) ? $_POST['lsm_export'] : false; if (!$lms) { return; } $export = LPR_Export::instance(); foreach ($lms as $l) { $provider = LPR_Export::get_provider($l); if ($provider) { $data = $provider->export_courses(); echo "["; print_r($data); echo "]"; } } die; }
<?php $exporter = LPR_Export::instance(); $plugins = $exporter->get_enable_plugins(); ?> <div class="wrap"> <h2><?php _e('Export', 'learnpress_import_export'); ?> </h2> <?php if ($plugins) { ?> <div class="updated"> <p><?php _e('We detected that some of lms systems is activated on your site and we can export their courses to import into LearnPress', 'learnpress_import_export'); ?> </p> <p><?php _e('Please select the lms system you want to exports their courses', 'learnpress_import_export'); ?> </p> </div> <form method="post"> <ul> <?php foreach ($plugins as $plugin_file => $details) { ?> <li> <label> <input name="lsm_export[]" type="checkbox" <?php