Automattic\WooCommerce\Internal\PushNotifications\DataStores

PushTokensDataStore::deletepublicWC 10.5.0

Deletes a push token.

Method of the class: PushTokensDataStore{}

No Hooks.

Returns

true|false. True on success.

Usage

$PushTokensDataStore = new PushTokensDataStore();
$PushTokensDataStore->delete( $id ): bool;
$id(int) (required)
The push token ID.

Changelog

Since 10.5.0 Introduced.

PushTokensDataStore::delete() code WC 10.8.1

public function delete( int $id ): bool {
	$post = get_post( $id );

	if ( ! $post || PushToken::POST_TYPE !== $post->post_type ) {
		throw new PushTokenNotFoundException();
	}

	return (bool) wp_delete_post( (int) $id, true );
}