WordPress at Your Fingertips
function is not described

WC_Cache_Helper::prevent_caching() public WC 1.0

Prevent caching on certain pages

{} It's a method of the class: WC_Cache_Helper{}

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Cache_Helper::prevent_caching();

Code of WC_Cache_Helper::prevent_caching() WC 5.9.0

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();
	}
}