Make WordPress Core

Ticket #46666: 46666.1.diff

File 46666.1.diff, 1.6 KB (added by socalchristina, 6 years ago)

Add wp_die_handler

  • src/wp-includes/functions.php

    diff --git src/wp-includes/functions.php src/wp-includes/functions.php
    index ff7841aba8..2e42914fdc 100644
    function wp_die( $message = '', $title = '', $args = array() ) { 
    30213021                $function = apply_filters( 'wp_die_xml_handler', '_xml_wp_die_handler' );
    30223022        } else {
    30233023                /**
    3024                  * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
     3024                 * Filters the callback for killing WordPress execution for JSONP requests.
     3025                 *
     3026                 * @since 5.2.0
     3027                 *
     3028                 * @param callable $function Callback function name.
     3029                 */
     3030                $function = apply_filters( 'wp_die_jsonp_handler', '_jsonp_wp_die_handler' );
     3031        } elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {
     3032                /**
     3033                 * Filters the callback for killing WordPress execution for charset requests.
     3034                 *
     3035                 * @since
     3036                 *
     3037                 * @param callable $function Callback function name.
     3038                 */
     3039                 $function = apply_filters( 'wp_die_canonical_charset_handler', '_canonical_charset_wp_die_handler' );
     3040        } elseif ( wp_is_charset_request(){
     3041
     3042                 function _canonical_charset( $charset ) {
     3043    if ( 'utf-8' === strtolower( $charset ) || 'utf8' === strtolower( $charset ) ) {
     3044
     3045        return 'UTF-8';
     3046    }
     3047}
     3048                /**
     3049                 * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests, non-charset.
    30253050                 *
    30263051                 * @since 3.0.0
    30273052                 *
    function _xml_wp_die_handler( $message, $title = '', $args = array() ) { 
    34093434    <message><![CDATA[{$message}]]></message>
    34103435    <data>
    34113436        <status>{$r['response']}</status>
    3412     </data> 
     3437    </data>
    34133438</error>
    34143439
    34153440EOD;