Thanks @teonsight ! Everything works great, but the FB link. It still requires for login when users come from FB.
Let’s say the site url is test.ro, my code looks like this:
$url_exclude = array('https://test.ro/',
'https://test.ro/',
'https://test.ro/?password-protected=login&redirect_to=http%3A%2F%2Ftest.ro%2F)';
//Other exceptions
$bOtherExc = false;
//if url is shared in FB - really raw check...
if(strstr($_SERVER['REQUEST_URI'], 'ro%2F%3Ffbclid')) {
$bOtherExc = true;
}
if( is_ssl() == 'https') {
$protocol = 'https';
} else {
$protocol = 'http';
}
$current_link = $protocol."://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if(in_array($current_link,$url_exclude) || $bOtherExc){
return;
}
Is there anything else that I need to change?
Thanks in advance!