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

Commit 8047840

Browse files
committed
add cache clearing unsupported message
1 parent 17f8d5a commit 8047840

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
@@ -552,8 +552,12 @@ public function execute_tool( $tool ) {
552552
break;
553553

554554
case 'clear_template_cache':
555-
wc_clear_template_cache();
556-
$message = __( 'Template cache cleared.', 'woocommerce-rest-api' );
555+
if ( function_exists( 'wc_clear_template_cache' ) ) {
556+
wc_clear_template_cache();
557+
$message = __( 'Template cache cleared.', 'woocommerce-rest-api' );
558+
} else {
559+
$message = __( 'The active version of WooCommerce does not support template cache clearing.', 'woocommerce-rest-api' );
560+
}
557561
break;
558562

559563
default:

0 commit comments

Comments
 (0)