PHP 25
WP Maintenance Redirect By micha on 23rd February 2022 09:17:13 AM
  1. function maintenance_redirect() {
  2.         if ( !is_user_logged_in() ) {
  3.           wp_redirect( "https://thiel-maschinen.de/maintenance/" );
  4.           exit;
  5.         }
  6. }
  7. add_action( 'template_redirect', 'maintenance_redirect' );

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.