Last active
September 25, 2023 22:57
-
-
Save tcmulder/5d179feb3cc9a7901be645eb06f3b1a3 to your computer and use it in GitHub Desktop.
WordPress Maint. Redirect
This file contains hidden or 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 | |
define( 'AQUAMIN_ADMIN_LOCKOUT', true ); | |
add_action( 'admin_init', function() { | |
if( AQUAMIN_ADMIN_LOCKOUT && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { | |
header( 'location: http://www.thinkaquamarine.com/maintenance.html' ); | |
// or use this to redirect internally: wp_safe_redirect( home_url( '/maint.html' ) ); | |
exit; | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment