• Resolved 93tjmac

    (@93tjmac)


    Hello!

    I apologize if this question has been asked before; I have searched for a while and have been unable to find this question and answer.

    I would like to know where the code is that enables maintenance mode (by creating the .maintenance file) when updating multiple plugins.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator t-p

    (@t-p)

    Mohamed Taman

    (@mohamedtaman)

    hello
    You can use this code

    function taman_maintenance_mode() {
    echo'
           <h1>
           We&rsquo;ll be back soon!
           </h1>
    
          <p>
           Sorry for the inconvenience but we&rsquo;re performing some maintenance at the moment. we&rsquo;ll be back online shortly!
          </p>
    ';
    
        }
    add_action('get_header', 'taman_maintenance_mode');
    Mohamed Taman

    (@mohamedtaman)

    or you can do like that

    if ( ! class_exists( 'classname' ) ) {
    
    add_action('get_header', 'taman_maintenance_mode');
    
    }

    if you want you can add return;

    if ( ! class_exists( 'classname' ) ) {
    
    add_action('get_header', 'taman_maintenance_mode');
    
    return;
    
    }
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Maintenance Mode’ is closed to new replies.