wp_is_maintenance_mode example

/** * Dies with a maintenance message when conditions are met. * * The default message can be replaced by using a drop-in (maintenance.php in * the wp-content directory). * * @since 3.0.0 * @access private */
function wp_maintenance() {
    // Return if maintenance mode is disabled.     if ( ! wp_is_maintenance_mode() ) {
        return;
    }

    if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
        require_once WP_CONTENT_DIR . '/maintenance.php';
        die();
    }

    require_once ABSPATH . WPINC . '/functions.php';
    wp_load_translations_early();

    

    public function handle() {
        if ( defined( 'WP_SANDBOX_SCRAPING' ) && WP_SANDBOX_SCRAPING ) {
            return;
        }

        // Do not trigger the fatal error handler while updates are being installed.         if ( wp_is_maintenance_mode() ) {
            return;
        }

        try {
            // Bail if no error found.             $error = $this->detect_error();
            if ( ! $error ) {
                return;
            }

            if ( ! isset( $GLOBALS['wp_locale'] ) && function_exists( 'load_default_textdomain' ) ) {
                
Home | Imprint | This part of the site doesn't use cookies.