Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 84b96bf

Browse files
rrennickvedanshujain
authored andcommitted
add cache clearing unsupported message
1 parent 8650285 commit 84b96bf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Controllers/Version2/class-wc-rest-system-status-tools-v2-controller.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,12 @@ public function execute_tool( $tool ) {
578578
break;
579579

580580
case 'clear_template_cache':
581-
wc_clear_template_cache();
582-
$message = __( 'Template cache cleared.', 'woocommerce-rest-api' );
581+
if ( function_exists( 'wc_clear_template_cache' ) ) {
582+
wc_clear_template_cache();
583+
$message = __( 'Template cache cleared.', 'woocommerce-rest-api' );
584+
} else {
585+
$message = __( 'The active version of WooCommerce does not support template cache clearing.', 'woocommerce-rest-api' );
586+
}
583587
break;
584588

585589
default:

0 commit comments

Comments
 (0)