Automattic\WooCommerce\Internal\StockNotifications

Notification::check_unsubscribe_key │ public │ WC 1.0

Check if the given key is a valid unsubscribe key.

Method of the class: Notification{}

No Hooks.

Returns

bool. True if the key is valid, false otherwise.

Usage

$Notification = new Notification();
$Notification->check_unsubscribe_key( $key ): bool;
$key(string) (required)
The key to check.

Notification::check_unsubscribe_key() code WC 11.2.2

public function check_unsubscribe_key( string $key ): bool {
	$stored = (string) $this->get_meta( 'unsubscribe_action_key' );
	if ( '' === $stored ) {
		return false;
	}
	return wp_verify_fast_hash( $key, $stored );
}