LLMS_Install::update_actions()

Handle form submission of update related actions


Description Description


Return Return

(void)


Top ↑

Source Source

File: includes/class.llms.install.php

	public static function update_actions() {

		// start the updater if the run button was clicked
		if ( ! empty( $_GET['llms-db-update'] ) ) {

			if ( ! wp_verify_nonce( $_GET['llms-db-update'], 'do_db_updates' ) ) {
				wp_die( __( 'Action failed. Please refresh the page and retry.', 'lifterlms' ) );
			}

			if ( ! current_user_can( 'manage_options' ) ) {
				wp_die( __( 'Cheatin’ huh?', 'lifterlms' ) );
			}

			// prevent page refreshes from triggering a second queue / batch
			if ( ! self::$background_updater->is_updating() ) {
				self::db_updates();
			}

			self::update_notice();

		}

		// force update triggered
		if ( ! empty( $_GET['llms-force-db-update'] ) ) {

			if ( ! wp_verify_nonce( $_GET['llms-force-db-update'], 'force_db_updates' ) ) {
				wp_die( __( 'Action failed. Please refresh the page and retry.', 'lifterlms' ) );
			}

			if ( ! current_user_can( 'manage_options' ) ) {
				wp_die( __( 'Cheatin’ huh?', 'lifterlms' ) );
			}

			do_action( 'wp_llms_bg_updater_cron' );

			wp_redirect( admin_url( 'admin.php?page=llms-settings' ) );

			exit;

		}

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.4.3 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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