add cache clearing unsupported message

This commit is contained in:
Ron Rennick 2020-06-15 13:15:31 -03:00 committed by vedanshujain
parent 865028556a
commit 84b96bfa3e
1 changed files with 6 additions and 2 deletions

View File

@ -578,8 +578,12 @@ class WC_REST_System_Status_Tools_V2_Controller extends WC_REST_Controller {
break; break;
case 'clear_template_cache': case 'clear_template_cache':
wc_clear_template_cache(); if ( function_exists( 'wc_clear_template_cache' ) ) {
$message = __( 'Template cache cleared.', 'woocommerce-rest-api' ); wc_clear_template_cache();
$message = __( 'Template cache cleared.', 'woocommerce-rest-api' );
} else {
$message = __( 'The active version of WooCommerce does not support template cache clearing.', 'woocommerce-rest-api' );
}
break; break;
default: default: