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.


Top ↑

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 );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.