Thanks for using Force Login – I’m glad you love it!
Yes, you could allow exceptions for visitors coming from any page from your primary product site by using the v_forcelogin_bypass filter.
You just need to figure out how you’re going to identify where the visitor came from to then bypass Force Login. You could for example, use the $_SERVER['HTTP_REFERER'] variable.
/**
* Bypass Force Login to allow for exceptions.
*
* @return bool Whether to disable Force Login. Default false.
*/
function my_forcelogin_bypass( $bypass ) {
if ( 'http://www.domain.com/' === $_SERVER['HTTP_REFERER'] ) {
$bypass = true;
}
return $bypass;
}
add_filter('v_forcelogin_bypass', 'my_forcelogin_bypass', 10, 1);
Keep in mind though, the $_SERVER['HTTP_REFERER'] is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.
http://php.net/manual/en/reserved.variables.server.php