Skip to content

Instantly share code, notes, and snippets.

@mjangda
Created August 16, 2012 14:28
Show Gist options
  • Save mjangda/3370524 to your computer and use it in GitHub Desktop.
Save mjangda/3370524 to your computer and use it in GitHub Desktop.
Custom WordPress maintenance mode that allows super admins access to the Dashboard
<?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