Automattic\WooCommerce\Internal\StockNotifications

Notification::check_unsubscribe_key │ public │ WC 1.0

Check if the given key is a valid unsubscribe key.

Метод класса: Notification{}

Хуков нет.

Возвращает

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

Использование

$Notification = new Notification();
$Notification->check_unsubscribe_key( $key ): bool;
$key(строка) (обязательный)
The key to check.

Код Notification::check_unsubscribe_key() WC 11.3.0

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 );
}