Skip to content

Commit

Permalink
add amp vary param
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejmackowiak committed Jan 30, 2020
1 parent cd6ee3f commit 5b7deb1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion widget-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function __construct()
),
"amp" => array(
&$this,
'is_amp_endpoint'
'amp_vary_param'
)
);
}
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit 5b7deb1

Please sign in to comment.