Automattic\WooCommerce\Internal\StockNotifications
Notification::get_verification_key
Maybe setup verification data for the notification.
This is used to ensure that the notification has valid verification data.
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() Notification::get verification key code WC 10.3.6
public function get_verification_key( bool $persist ): string {
$key = wp_generate_password( 20, false );
$this->update_meta_data( 'email_link_action_key', time() . ':' . HasherHelper::wp_fast_hash( $key ) );
if ( $persist ) {
$this->save();
}
return $key;
}