Created
February 5, 2020 17:54
-
-
Save coulterpeterson/4c52993f6a51afed3f9d1b9f9093ca22 to your computer and use it in GitHub Desktop.
Temporarily block users from editing in the #WordPress Dashboard #php
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
// Maintenance mode function | |
add_action('admin_head', 'block_admin_editing_style'); | |
function block_admin_editing_style() { | |
echo "<style> | |
#wpwrap{ | |
display:none!important; | |
} | |
</style> | |
<script> | |
jQuery(document).ready(function($){ | |
$('body').prepend('<h1 style=\'line-height: 1.2em;text-align: center;padding: 0 10vw;\'>Site temporarily blocked from editing due to maintenance. Please contact [email protected] if you have questions or concerns. Thank you kindly for your understanding.</h1>'); | |
}); | |
</script>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment