Lego2012
12/13/2016 - 11:51 AM

Switch on Maintenance Mode

Switch on Maintenance Mode

<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

<!-- 
Need a quick maintenance mode? Use this snippet. Just comment it out when you don’t want it switched on. 
-->

<?php
function maintenace_mode() {
  if ( !current_user_can( 'administrator' ) ) {
    wp_die('Maintenance.');
  }
}
add_action('get_header', 'maintenace_mode');
?>