This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) ) : | |
// Disable caching on checkout pages as per https://pantheon.io/docs/cache-control/ | |
$regex_path_match = '#/foundation/donation-options/(checkout|shopping-cart)#'; | |
if (preg_match($regex_path_match, $_SERVER['REQUEST_URI'])) { | |
// Use a later priority to make sure it runs after native Pantheon caching | |
add_action( 'send_headers', 'cth_add_header_nocache', 50 ); |