Whitelist every page/post except for woocommerce
-
Your plugin works too well! ??
I’ve been trying to implement the whitelist code into my functions.php for my child theme. (parent theme = Bridge)
What i want to do is require login for only woocommerce pages. But when i add all the exceptions including the homepage url it doesn’t whitelist any pages, both absolute URL and using WordPress siteurl = (”) function.
here is how i tried to make it work in my child themes functions.php file:
/**
* Filter Force Login to allow exceptions for specific URLs.
*
* @return array An array of URLs. Must be absolute.
**/
function my_forcelogin_whitelist( $whitelist ) {
$whitelist[] = site_url( ‘/about-us/’ );
$whitelist[] = site_url( ” );
return $whitelist;
}
add_filter(‘v_forcelogin_whitelist’, ‘my_forcelogin_whitelist’, 10, 1);I’ve tried variations of this, no dice.
my staging site is procraft.jlbdev.net
Thanks
- The topic ‘Whitelist every page/post except for woocommerce’ is closed to new replies.