Noptin_Page::pre_unsubscribe_user( $page )
Unsubscribes a user
Return Return
(array)
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; } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.2.7 | Introduced. |