LLMS_Staging::handle_staging_notice_actions()

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


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 ( ! llms_verify_nonce( '_llms_staging_nonce', 'llms_staging_status', 'GET' ) || ! current_user_can( 'manage_options' ) ) {
			wp_die( __( 'Action failed. Please refresh the page and retry.', 'lifterlms' ) );
		}

		$action = llms_filter_input( INPUT_GET, 'llms-staging-status' );
		if ( 'enable' === $action ) {
			LLMS_Site::set_lock_url();
			LLMS_Site::update_feature( 'recurring_payments', true );
		} elseif ( 'disable' === $action ) {
			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' );

		if ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
			llms_redirect_and_exit( sanitize_text_field( wp_unslash( $_SERVER['HTTP_REFERER'] ) ) );
		}

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.9.0 Drop usage of deprecated FILTER_SANITIZE_STRING.
4.12.0 Use llms_filter_input() for retrieval of $_GET data.
3.35.0 Sanitize input data.
3.32.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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