Automattic\WooCommerce\Internal\StockNotifications

Notification::get_verification_key │ public │ WC 1.0

Generate a verification key and store its hash.

Method of the class: Notification{}

No Hooks.

Returns

string. The generated verification key.

Usage

$Notification = new Notification();
$Notification->get_verification_key( $persist ): string;
$persist(true|false) (required)
If true, save the changes to the database.

Notification::get_verification_key() code WC 11.2.2

public function get_verification_key( bool $persist ): string {
	$key = wp_generate_password( 20, false );
	$this->update_meta_data( 'verification_action_key', time() . ':' . wp_fast_hash( $key ) );

	if ( $persist ) {
		$this->save();
	}

	return $key;
}