Skip to content

Commit dc9a552

Browse files
author
Marco Pereirinha
committed
Allow a soft cache flush
1 parent 957b1de commit dc9a552

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

php/class-delivery.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,11 +705,16 @@ public function clear_cache() {
705705
/**
706706
* Delete cached metadata.
707707
*
708+
* @param bool $hard Whether to hard flush the cache.
709+
*
708710
* @hook cloudinary_flush_cache
709711
*/
710-
public function do_clear_cache() {
712+
public function do_clear_cache( $hard = true ) {
711713
delete_post_meta_by_key( self::META_CACHE_KEY );
712-
wp_cache_flush();
714+
715+
if ( $hard ) {
716+
wp_cache_flush();
717+
}
713718
}
714719

715720
/**

0 commit comments

Comments
 (0)