get_route(), '/groupentry/v1/')) { $response = rest_ensure_response($response); $response->header('Cache-Control', 'private, no-store, max-age=0'); $response->header('X-Robots-Tag', 'noindex, nofollow'); } return $response; }, 10, 3); add_action('template_redirect', static function () { if (is_singular()) { $post = get_post(); if ($post && (has_shortcode($post->post_content, 'groupentry_registration') || has_shortcode($post->post_content, 'groupentry_checkin'))) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound -- Shared cache-plugin convention prevents caching private registration pages. if (!defined('DONOTCACHEPAGE')) { define('DONOTCACHEPAGE', true); } nocache_headers(); header('Referrer-Policy: no-referrer'); } } });