Automattic\WooCommerce\Internal\PushNotifications\DataStores
NotificationPreferencesDataStore::delete
Delete a user's stored preferences for this site.
Multisite keeps a separate envelope per site, so this removes only the one belonging to the current site.
Method of the class: NotificationPreferencesDataStore{}
No Hooks.
Returns
bool. True when an envelope was removed, false when there was nothing stored.
Usage
$NotificationPreferencesDataStore = new NotificationPreferencesDataStore(); $NotificationPreferencesDataStore->delete( $user_id ): bool;
- $user_id(int) (required)
- The user ID.
Changelog
| Since 11.2.0 | Introduced. |
NotificationPreferencesDataStore::delete() NotificationPreferencesDataStore::delete code WC 11.3.0
public function delete( int $user_id ): bool {
return Users::delete_site_user_meta( $user_id, self::META_KEY );
}