From 5b7deb1cd32c9511eca0c4302a4c9cb21800b6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Ma=C4=87kowiak?= Date: Thu, 30 Jan 2020 19:40:15 +0100 Subject: [PATCH] add amp vary param --- widget-cache.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/widget-cache.php b/widget-cache.php index 9412a85..cd97f18 100644 --- a/widget-cache.php +++ b/widget-cache.php @@ -109,7 +109,7 @@ function __construct() ), "amp" => array( &$this, - 'is_amp_endpoint' + 'amp_vary_param' ) ); } @@ -580,6 +580,13 @@ function get_user_agent() return $_SERVER ['HTTP_USER_AGENT']; } + function amp_vary_param(){ + if(function_exists('is_amp_endpoint') && is_amp_endpoint()){ + return 'amp'; + } else { + return 'non-amp'; + } + } function get_current_category() { if (is_single()) {