Deleted cached webhook data when deleting a webhook

This commit is contained in:
James Collins 2019-12-04 12:04:35 +08:00
parent 3519b5bd5c
commit b29f8cc1bd
1 changed files with 1 additions and 0 deletions

View File

@ -184,6 +184,7 @@ class WC_Webhook_Data_Store implements WC_Webhook_Data_Store_Interface {
); // WPCS: cache ok, DB call ok.
$this->delete_transients( 'all' );
wp_cache_delete( $webhook->get_id(), 'webhooks' );
WC_Cache_Helper::invalidate_cache_group( 'webhooks' );
do_action( 'woocommerce_webhook_deleted', $webhook->get_id(), $webhook );
}