WordPress.org

Make WordPress Core

Changeset 45019


Ignore:
Timestamp:
03/26/2019 11:38:37 PM (13 months ago)
Author:
SergeyBiryukov
Message:

Bootstrap/Load: Use wp_die() instead of hardcoded HTML in wp_maintenance(), so the output can be filtered by plugins.

Props spacedmonkey.
Fixes #45974.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/load.php

    r45018 r45019  
    214214        die();
    215215    }
    216 
     216   
     217    require_once( ABSPATH . WPINC . '/functions.php' );
    217218    wp_load_translations_early();
    218219
    219     $protocol = wp_get_server_protocol();
    220     header( "$protocol 503 Service Unavailable", true, 503 );
    221     header( 'Content-Type: text/html; charset=utf-8' );
    222220    header( 'Retry-After: 600' );
    223221
    224     $dir_attr = '';
    225     if ( is_rtl() ) {
    226         $dir_attr = ' dir="rtl"';
    227     }
    228     ?>
    229     <!DOCTYPE html>
    230     <html xmlns="http://www.w3.org/1999/xhtml"<?php echo $dir_attr; ?>>
    231     <head>
    232     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    233         <title><?php _e( 'Maintenance' ); ?></title>
    234 
    235     </head>
    236     <body>
    237         <h1><?php _e( 'Briefly unavailable for scheduled maintenance. Check back in a minute.' ); ?></h1>
    238     </body>
    239     </html>
    240     <?php
    241     die();
     222    wp_die(
     223        __( 'Briefly unavailable for scheduled maintenance. Check back in a minute.' ),
     224        __( 'Maintenance' ),
     225        503
     226    );
    242227}
    243228
Note: See TracChangeset for help on using the changeset viewer.