Skip to content

Commit 85cfc20

Browse files
authored
Merge pull request #61 from OpenWebconcept/feature/AS-21249
Added check if rest cache plugin is active
2 parents 6987a2b + fb6c1fc commit 85cfc20

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/admin/class-admin.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,11 @@ public static function flush_cache_for_specific_endpoints( $post_id = null ) {
524524
* @return void
525525
*/
526526
public static function flush_openkaarten_datasets_cache() {
527+
// Check if the post is saved or updated.
528+
if ( ! is_plugin_active( 'wp-rest-cache/wp-rest-cache.php' ) ) {
529+
return;
530+
}
531+
527532
Caching::get_instance()->delete_cache_by_endpoint( '%/owc/openkaarten/v1/datasets', Caching::FLUSH_LOOSE, true );
528533
}
529534
}

0 commit comments

Comments
 (0)