Skip to content

Instantly share code, notes, and snippets.

@vidluther
Forked from mjangda/s-maintenance-mode.php
Created August 16, 2012 21:49
Show Gist options
  • Save vidluther/3373917 to your computer and use it in GitHub Desktop.
Save vidluther/3373917 to your computer and use it in GitHub Desktop.

Revisions

  1. @mjangda mjangda created this gist Aug 16, 2012.
    12 changes: 12 additions & 0 deletions s-maintenance-mode.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    <?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' );
    }
    }