LLMS_Admin_Setup_Wizard::save_finish()
Save the “Finish” step.
Return Return
(WP_Error|int[]|bool) Returns an array of generated WP_Post IDs on success, false when no import IDs are posted, otherwise returns a WP_Error.
Source Source
File: includes/admin/class.llms.admin.setup.wizard.php
protected function save_finish() {
$ids = (array) llms_filter_input( INPUT_POST, 'llms_setup_course_import_ids', FILTER_DEFAULT, FILTER_FORCE_ARRAY );
$ids = array_filter( array_map( 'absint', $ids ) );
if ( ! $ids ) {
return false;
}
$res = LLMS_Export_API::get( $ids );
if ( is_wp_error( $res ) ) {
return $res;
}
$gen = new LLMS_Generator( $res );
$gen->set_generator();
$gen->generate();
if ( $gen->is_error() ) {
return $gen->get_results();
}
return $gen->get_generated_courses();
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 4.8.0 | Introduced. |