LLMS_Admin_Import::cloud_import()
Handle form submission of a cloud import file
Return Return
(WP_Error|boolean) Returns false for nonce or user permission errors, true on success, or an error object.
Source Source
File: includes/admin/class.llms.admin.import.php
public function cloud_import() {
if ( ! llms_verify_nonce( 'llms_cloud_importer_nonce', 'llms-cloud-importer' ) || ! current_user_can( 'manage_lifterlms' ) ) {
return false;
}
$course_id = llms_filter_input( INPUT_POST, 'llms_cloud_import_course_id', FILTER_SANITIZE_NUMBER_INT );
if ( ! $course_id ) {
return $this->show_error( new WP_Error( 'llms-cloud-import-missing-id', __( 'Error: Missing course ID.', 'lifterlms' ) ) );
}
$res = LLMS_Export_API::get( array( $course_id ) );
if ( is_wp_error( $res ) ) {
return $this->show_error( $res );
}
return $this->handle_generation( $res );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 4.8.0 | Introduced. |