"Make Blog Members Only" Setting Doesn't Work
-
I’m using this plugin on a multisite install and haven’t had a chance to test on a non-multisite install. This problem might be specific to multisite WordPress instances, although looking at the code I don’t see why this issue wouldn’t also occur in non-multisite installs.
When I have the “Make Blog Members Only” setting ticked on the WAC settings page, the main page of the blog is still accessible to users who aren’t logged in.
This is because the global $post variable is empty on the home page, and the check_for_members_only function on line 289 of wordpress-access-control.php returns (and doesn’t redirect the user) if $post is falsey (line 293).
This can be rectified by removing the “|| !$post” from line 293 and adding:
if (is_admin() || !$post) { return; }
to line 310, after the blog_is_members_only check.
Brandon, could you please make that change for the next update?
https://www.ads-software.com/plugins/wordpress-access-control/
- The topic ‘"Make Blog Members Only" Setting Doesn't Work’ is closed to new replies.