Created
August 16, 2012 14:28
-
-
Save mjangda/3370524 to your computer and use it in GitHub Desktop.
Custom WordPress maintenance mode that allows super admins access to the Dashboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', 'x_maintenance_mode' ); | |
function x_maintenance_mode() { | |
if ( defined( 'X_MAINTENANCE_MODE' ) && true === X_MAINTENANCE_MODE ) { | |
if ( is_super_admin() && is_admin() ) | |
return; | |
die( 'Site is currently under maintenance' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment