LLMS_Admin_Setup_Wizard::save()

Handle saving data during setup


Return Return

(null|WP_Error)


Top ↑

Source Source

File: includes/admin/class.llms.admin.setup.wizard.php

	public function save() {

		if ( ! isset( $_POST['llms_setup_nonce'] ) || ! llms_verify_nonce( 'llms_setup_nonce', 'llms_setup_save' ) || ! current_user_can( 'manage_lifterlms' ) ) {
			return null;
		}

		$res = new WP_Error( 'llms-setup-save-invalid', __( 'There was an error saving your data, please try again.', 'lifterlms' ) );

		$step = llms_filter_input( INPUT_POST, 'llms_setup_save' );
		if ( method_exists( $this, 'save_' . $step ) ) {
			$res = call_user_func( array( $this, 'save_' . $step ) );
		}

		if ( is_wp_error( $res ) ) {
			$this->error = $res;
			return $res;
		}

		$url = ( 'finish' === $step ) ? $this->get_completed_url( $res ) : $this->get_step_url( $this->get_next_step() );

		return llms_redirect_and_exit( $url );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.9.0 Stop using deprecated FILTER_SANITIZE_STRING.
4.8.0 Moved logic for each wizard step into it's own method.
3.37.14 Ensure redirect to proper course when a course is imported at the end of setup.
3.35.0 Sanitize input data; load sample data from sample-data directory.
3.3.0 Unknown.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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