diff --git src/wp-includes/class-wp-shutdown-handler.php src/wp-includes/class-wp-shutdown-handler.php
index c55901dd4a..77771fb4fd 100644
|
|
class WP_Shutdown_Handler { |
136 | 136 | $php_error_pluggable = WP_CONTENT_DIR . '/php-error.php'; |
137 | 137 | if ( is_readable( $php_error_pluggable ) ) { |
138 | 138 | require_once $php_error_pluggable; |
139 | | die(); |
| 139 | $args = array( |
| 140 | 'response' => 500, |
| 141 | 'exit' => false, |
| 142 | ); |
| 143 | |
| 144 | wp_die( '', '', $args ); |
140 | 145 | } |
141 | 146 | } |
142 | 147 | |
… |
… |
class WP_Shutdown_Handler { |
166 | 171 | |
167 | 172 | $message = __( 'The site is experiencing technical difficulties.' ); |
168 | 173 | |
169 | | $args = array( 'response' => 500 ); |
| 174 | $args = array( |
| 175 | 'response' => 500, |
| 176 | 'exit' => false, |
| 177 | ); |
| 178 | |
170 | 179 | if ( function_exists( 'admin_url' ) ) { |
171 | 180 | $args['link_url'] = admin_url(); |
172 | 181 | $args['link_text'] = __( 'Log into the admin backend to fix this.' ); |
diff --git src/wp-includes/functions.php src/wp-includes/functions.php
index 9552455d05..d11f309f34 100644
|
|
function wp_nonce_ays( $action ) { |
2955 | 2955 | * @type string $text_direction The text direction. This is only useful internally, when WordPress |
2956 | 2956 | * is still loading and the site's locale is not set up yet. Accepts 'rtl'. |
2957 | 2957 | * Default is the value of is_rtl(). |
| 2958 | * @type bool $exit Whether to exit the process after completion. Defaults to true. |
2958 | 2959 | * } |
2959 | 2960 | */ |
2960 | 2961 | function wp_die( $message = '', $title = '', $args = array() ) { |
… |
… |
function wp_die( $message = '', $title = '', $args = array() ) { |
3021 | 3022 | * @param string|array $args Optional. Arguments to control behavior. Default empty array. |
3022 | 3023 | */ |
3023 | 3024 | function _default_wp_die_handler( $message, $title = '', $args = array() ) { |
3024 | | $defaults = array( 'response' => 500 ); |
| 3025 | $defaults = array( 'response' => 500, 'exit' => true ); |
3025 | 3026 | $r = wp_parse_args( $args, $defaults ); |
3026 | 3027 | |
3027 | 3028 | $have_gettext = function_exists( '__' ); |
… |
… |
function _default_wp_die_handler( $message, $title = '', $args = array() ) { |
3218 | 3219 | <body id="error-page"> |
3219 | 3220 | <?php endif; // ! did_action( 'admin_head' ) ?> |
3220 | 3221 | <?php echo $message; ?> |
3221 | | </body> |
3222 | | </html> |
| 3222 | <?php // Open a display: none div to catch any subsequent output and hide it by default. ?> |
| 3223 | <div style="display: none;"> |
3223 | 3224 | <?php |
3224 | | die(); |
| 3225 | |
| 3226 | if ( true === $args['exit'] ) { |
| 3227 | die(); |
| 3228 | } |
3225 | 3229 | } |
3226 | 3230 | |
3227 | 3231 | /** |
… |
… |
function _json_wp_die_handler( $message, $title = '', $args = array() ) { |
3255 | 3259 | } |
3256 | 3260 | |
3257 | 3261 | echo wp_json_encode( $data ); |
3258 | | die(); |
| 3262 | |
| 3263 | if ( true === $args['exit'] ) { |
| 3264 | die(); |
| 3265 | } |
3259 | 3266 | } |
3260 | 3267 | |
3261 | 3268 | /** |
… |
… |
function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) { |
3282 | 3289 | $error = new IXR_Error( $r['response'], $message ); |
3283 | 3290 | $wp_xmlrpc_server->output( $error->getXml() ); |
3284 | 3291 | } |
3285 | | die(); |
| 3292 | |
| 3293 | if ( true === $args['exit'] ) { |
| 3294 | die(); |
| 3295 | } |
3286 | 3296 | } |
3287 | 3297 | |
3288 | 3298 | /** |
… |
… |
function _ajax_wp_die_handler( $message, $title = '', $args = array() ) { |
3307 | 3317 | status_header( $r['response'] ); |
3308 | 3318 | } |
3309 | 3319 | |
3310 | | if ( is_scalar( $message ) ) { |
3311 | | die( (string) $message ); |
| 3320 | echo is_scalar( $message ) ? (string) $message : '0'; |
| 3321 | |
| 3322 | if ( true === $args['exit'] ) { |
| 3323 | die(); |
3312 | 3324 | } |
3313 | | die( '0' ); |
3314 | 3325 | } |
3315 | 3326 | |
3316 | 3327 | /** |
… |
… |
function _ajax_wp_die_handler( $message, $title = '', $args = array() ) { |
3325 | 3336 | */ |
3326 | 3337 | function _scalar_wp_die_handler( $message = '' ) { |
3327 | 3338 | if ( is_scalar( $message ) ) { |
3328 | | die( (string) $message ); |
| 3339 | echo (string) $message; |
| 3340 | } |
| 3341 | |
| 3342 | if ( true === $args['exit'] ) { |
| 3343 | die(); |
3329 | 3344 | } |
3330 | | die(); |
3331 | 3345 | } |
3332 | 3346 | |
3333 | 3347 | /** |