Posted By

planetabhi on 05/30/12


Tagged

wordpress


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

equi
Dane_Collins


When you need to put your wordpress blog on hold while performing some maintenance.


 / Published in: PHP
 

Just paste the following snippet into your functions.php file and save it.

  1. function cwc_maintenance_mode() {
  2. if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {
  3. wp_die('Maintenance, please come back soon.');
  4. }
  5. }
  6. add_action('get_header', 'cwc_maintenance_mode');

Report this snippet  

You need to login to post a comment.