Skip to content

Instantly share code, notes, and snippets.

@pxpxpx-code
Created April 17, 2020 13:56
Show Gist options
  • Save pxpxpx-code/da66e3e917e83243c7b8bc55ddee5889 to your computer and use it in GitHub Desktop.
Save pxpxpx-code/da66e3e917e83243c7b8bc55ddee5889 to your computer and use it in GitHub Desktop.
WordPress Wartungsmodus aktivieren
// Activate WordPress Maintenance Mode
function wp_maintenance_mode(){
if(!current_user_can('edit_themes') || !is_user_logged_in()){
wp_die('<h1 style="color:red">Wartungsmodus</h1><br />Diese Webseite wird momentan gewartet. Wir sind in Kürze wieder erreichbar!');
}
}
add_action('get_header', 'wp_maintenance_mode');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment