Skip to content

Commit

Permalink
update: dokan_product_cache_delete_all_data filter added in `Produc…
Browse files Browse the repository at this point in the history
…tCache::delete()` (getdokan#2170)
  • Loading branch information
shohag121 authored Feb 28, 2024
1 parent 7de1186 commit 6536632
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions includes/Product/ProductCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ public function clear_seller_product_caches( $product ) {
* @return void
*/
public static function delete( $seller_id ) {
$proceed = apply_filters( 'dokan_product_cache_delete_all_data', true, $seller_id );

if ( ! $proceed ) {
return;
}

Cache::invalidate_group( 'product_data' );
Cache::invalidate_group( "seller_product_data_{$seller_id}" );
Cache::invalidate_group( "seller_product_stock_data_{$seller_id}" );
Expand Down

0 comments on commit 6536632

Please sign in to comment.