WC_Cache_Helper::prevent_caching()
Prevent caching on certain pages
Method of the class: WC_Cache_Helper{}
No Hooks.
Return
null
. Nothing (null).
Usage
$result = WC_Cache_Helper::prevent_caching();
WC_Cache_Helper::prevent_caching() WC Cache Helper::prevent caching code WC 9.3.1
public static function prevent_caching() { if ( ! is_blog_installed() ) { return; } $page_ids = array_filter( array( wc_get_page_id( 'cart' ), wc_get_page_id( 'checkout' ), wc_get_page_id( 'myaccount' ) ) ); if ( is_page( $page_ids ) ) { self::set_nocache_constants(); nocache_headers(); } }