LLMS_Staging::handle_staging_notice_actions()

Handle the action buttons present in the recurring payments staging notice.


Description Description


Return Return

(void)


Top ↑

Source Source

File: includes/class-llms-staging.php

	public static function handle_staging_notice_actions() {

		if ( ! isset( $_GET['llms-staging-status'] ) || ! isset( $_GET['_llms_staging_nonce'] ) ) {
			return;
		}

		if ( ! wp_verify_nonce( $_GET['_llms_staging_nonce'], 'llms_staging_status' ) ) {
			wp_die( __( 'Action failed. Please refresh the page and retry.', 'lifterlms' ) );
		}
		if ( ! current_user_can( 'manage_options' ) ) {
			wp_die( __( 'Cheatin’ huh?', 'lifterlms' ) );
		}

		if ( 'enable' === $_GET['llms-staging-status'] ) {
			LLMS_Site::set_lock_url();
			LLMS_Site::update_feature( 'recurring_payments', true );
		} elseif ( 'disable' === $_GET['llms-staging-status'] ) {
			LLMS_Site::clear_lock_url();
			LLMS_Site::update_feature( 'recurring_payments', false );
			update_option( 'llms_site_url_ignore', 'yes' );
		}

		LLMS_Admin_Notices::delete_notice( 'maybe-staging' );

		llms_redirect_and_exit( $_SERVER['HTTP_REFERER'] );

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.32.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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