Clear webhook transients when status changes
Background discussion: https://github.com/woocommerce/woocommerce/pull/21427#discussion_r246881785
This commit is contained in:
parent
28ca9f1ec4
commit
2ed2572afe
|
@ -152,6 +152,10 @@ class WC_Webhook_Data_Store implements WC_Webhook_Data_Store_Interface {
|
||||||
|
|
||||||
$webhook->apply_changes();
|
$webhook->apply_changes();
|
||||||
|
|
||||||
|
if ( isset( $changes['status'] ) ) {
|
||||||
|
// We need to delete all transients, because we can't be sure of the old status.
|
||||||
|
$this->delete_transients( 'all' );
|
||||||
|
}
|
||||||
wp_cache_delete( $webhook->get_id(), 'webhooks' );
|
wp_cache_delete( $webhook->get_id(), 'webhooks' );
|
||||||
WC_Cache_Helper::incr_cache_prefix( 'webhooks' );
|
WC_Cache_Helper::incr_cache_prefix( 'webhooks' );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue