Mar 28
Maintenance mode that blocks access to signed in users.
Currently the maintenance page only shows for anonymous users. If a general user is signed in already (I'm not talking about admin users), then the users can continue to browse the site without seeing the maintenance page. This issue makes the current maintenance mode a bit pointless. We don't really want to install another plugin to get a maintenance page that works. Instead we are using the WordPress Functions.php code which checks if the current user is not logged in or doesn't have the necessary permission to edit themes and if so, replace the page content with the maintenance message. This code works well, if you could add this it would be great as the standard WordPress page is very dull to look at.
// Activate WordPress Maintenance Mode
function wp_maintenance_mode() {
if (!current_user_can('edit_themes') || !is_user_logged_in()) {
wp_die('<h1>Under Maintenance</h1><br />Website under planned maintenance. Please check back later.');
}
}
add_action('get_header', 'wp_maintenance_mode');
Pending
I had assumed this was the case already. Thanks for alerting me that it isn't.