Skip to content

Instantly share code, notes, and snippets.

@mikemanger
mikemanger / .maintenance
Last active September 14, 2021 02:26
Example WordPress .maintenance file. maintenance.php is optional but useful for styling the message the public will see (it is also used when updating WordPress conponments), drop it in your wp-content folder.
<?php
function is_user_logged_in() {
$loggedin = false;
foreach ( (array) $_COOKIE as $cookie => $value ) {
if ( stristr( $cookie, 'wordpress_logged_in_' ) ) {
$loggedin = true;
}
}
return $loggedin;
}