confirm_noptin_subscriber_email( $subscriber )

Marks a subscriber as confirmed (Double Opt-in)


Source Source

File: includes/subscriber.php

function confirm_noptin_subscriber_email( $subscriber ) {
	global $wpdb;

	// Prepare the subscriber.
	$subscriber = new Noptin_Subscriber( $subscriber );
	if ( ! $subscriber->exists() || ! empty( $subscriber->confirmed ) ) {
		return false;
	}

	do_action( 'noptin_before_confirm_subscriber_email', $subscriber );

	$table = get_noptin_subscribers_table_name();
	$wpdb->update(
		$table,
		array(
			'active'    => 0,
			'confirmed' => 1,
		),
		array( 'id' => $subscriber->id ),
		'%d',
		'%d'
	);

	$subscriber->clear_cache();

	update_noptin_subscriber_meta( $subscriber->id, 'confirmed_on', current_time( 'mysql' ) );
	do_action( 'noptin_subscriber_confirmed', new Noptin_Subscriber( $subscriber->id ) );

	return true;

}


Top ↑

Changelog Changelog

Changelog
VersionDescription
1.3.2Introduced.

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