Noptin_Page::pre_unsubscribe_user( $page )

Unsubscribes a user


Return Return

(array)


Top ↑

Source Source

File: includes/class-noptin-page.php

	public function pre_unsubscribe_user( $page ) {

		// Make sure that the confirmation key exists.
		$value = $this->get_request_value();

		if ( empty( $value )  ) {
			return;
		}

		// Fetch the subscriber.
		$subscriber = Noptin_Subscriber::get_data_by( 'confirm_key', $value );

		// Unsubscribe them.
		unsubscribe_noptin_subscriber( $subscriber );

		// If we are redirecting by page id, fetch the page's permalink.
		if ( is_numeric( $page ) ) {
			$page = get_permalink( $page );
		}

		// If we have a redirect, redirect.
		if ( ! empty( $page ) ) {
			wp_redirect( $page );
			exit;
		}

	}


Top ↑

Changelog Changelog

Changelog
VersionDescription
1.2.7Introduced.

Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation