Created
June 28, 2011 14:46
-
-
Save wildiney/1051288 to your computer and use it in GitHub Desktop.
WordPress - Put your site in Maintenace mode
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 | |
function maintenance_mode() { | |
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) { | |
wp_die('Maintenance, please come back soon.'); | |
} | |
} | |
add_action('get_header', 'maintenance_mode'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment