WordPress.org

Make WordPress Core

Ticket #46047: 46047.diff

File 46047.diff, 1.3 KB (added by schlessera, 13 months ago)
  • src/wp-includes/class-wp-shutdown-handler.php

    diff --git src/wp-includes/class-wp-shutdown-handler.php src/wp-includes/class-wp-shutdown-handler.php
    index c55901dd4a..8354fbd149 100644
    class WP_Shutdown_Handler { 
    2626         */
    2727        public function handle() {
    2828                // Bail if WordPress executed successfully.
    29                 if ( defined( 'WP_EXECUTION_SUCCEEDED' ) && WP_EXECUTION_SUCCEEDED ) {
     29                if ( defined( 'WP_DISABLE_SHUTDOWN_HANDLER' ) && WP_DISABLE_SHUTDOWN_HANDLER ) {
    3030                        return;
    3131                }
    3232
  • src/wp-settings.php

    diff --git src/wp-settings.php src/wp-settings.php
    index 781d8e6ca1..54e60eece8 100644
    if ( is_multisite() ) { 
    532532do_action( 'wp_loaded' );
    533533
    534534/*
    535  * Store the fact that we could successfully execute the entire WordPress
    536  * lifecycle. This is used to skip the premature shutdown handler, as it cannot
    537  * be unregistered.
     535 * Once we could successfully execute the entire WordPress lifecycle, we use
     536 * this constant to skip the premature shutdown handler, as it cannot be
     537 * unregistered.
    538538 */
    539 if ( ! defined( 'WP_EXECUTION_SUCCEEDED' ) ) {
    540         define( 'WP_EXECUTION_SUCCEEDED', true );
     539if ( ! defined( 'WP_DISABLE_SHUTDOWN_HANDLER' ) ) {
     540        define( 'WP_DISABLE_SHUTDOWN_HANDLER', true );
    541541}