Sometimes, you may have a site that you want to be viewed by only logged in users. Especially if it’s some type of internal tool used by a private company or group. I recently needed to this on a site I was using to test out some themes, so I thought I would share it in case someone out there needed something similar.
It’s not a very complicated plugin but it gets the job done.
Here’s the code:
is_login() ) { wp_redirect( admin_url() ); exit; } } public function is_login() { return in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) ); } } $bavotasan_private = new Bavotasan_Private;
You can download it through the link below.