Purge cache function not working
-
We have a woocommerce store with checkbox in the backend to open and close the store. Inside child-themes functions.php there is a function that checks the box and adds appropriate class to body.
The checkbox-update and body class only show after we manually hit “Purge SG Cache” from the backend.
We wish include this through the functions, but so far no luck. If we change the checkbox, the bodyclass only shows after manual purge.
The snippet of the bodyclass code is below. Could you help us out, we are probably missing something here.
For testing purposes we added both the purge-codes you provided. But nothing happens, unless we use the backend button to purge.
// // add class on checkbox function my_body_classes( $classes ) { if (function_exists('sg_cachepress_purge_everything')) { sg_cachepress_purge_everything(); } if (function_exists('sg_cachepress_purge_cache')) { sg_cachepress_purge_cache(); } if( wfs_is_service_enabled() ) { $classes[] = 'StoreIsNOTServing'; } return $classes; } add_filter( 'body_class','my_body_classes' );
- The topic ‘Purge cache function not working’ is closed to new replies.