-
-
Save JoeSz/fbdfbc3837f7044bd9ea5252aa64b8ba to your computer and use it in GitHub Desktop.
WordPress hook to activate a basic maintenance mode showing a message for everybody but the administrator
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
function wh_maintenance_mode() { | |
if ( !is_user_logged_in() || !current_user_can('administrator') ) { | |
wp_die( 'Dritte Variante einer Wartungsseite', 'Wartung!', array( 'response' => '503')); | |
} | |
} | |
add_action( 'get_header', 'wh_maintenance_mode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment