Skip to content

Commit

Permalink
added userLoggedIn vary param
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejmackowiak committed Feb 6, 2020
1 parent 5b7deb1 commit 799b980
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions widget-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ function __construct()
&$this,
'get_user_level'
),
"userLoggedIn" => array(
&$this,
'get_is_user_logged_in'
),
"userAgent" => array(
&$this,
'get_user_agent'
Expand All @@ -109,7 +113,7 @@ function __construct()
),
"amp" => array(
&$this,
'amp_vary_param'
'get_amp_vary_param'
)
);
}
Expand Down Expand Up @@ -575,12 +579,17 @@ function get_user_level()
return false;
}

function get_is_user_logged_in()
{
return (is_user_logged_in() ? 'logged' : 'not_logged');
}

function get_user_agent()
{
return $_SERVER ['HTTP_USER_AGENT'];
}

function amp_vary_param(){
function get_amp_vary_param(){
if(function_exists('is_amp_endpoint') && is_amp_endpoint()){
return 'amp';
} else {
Expand Down

0 comments on commit 799b980

Please sign in to comment.