WC_Cache_Helper::prevent_caching()public staticWC 1.0

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() code WC 8.7.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();
	}
}