wp_die

The timeline below displays how wordpress function wp_die has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.5

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty string.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response code.
 *                                  Default empty string.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_serving_rest_request() && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($callback, $message, $title, $args);
}

WordPress Version: 6.2

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty string.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response code.
 *                                  Default empty string.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($callback, $message, $title, $args);
}

WordPress Version: 6.1

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $callback Callback function name.
         */
        $callback = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($callback, $message, $title, $args);
}

WordPress Version: 8.1

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 5.8

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 7.3

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 7.2

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: .10

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 5.7

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 6.5

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 6.2

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: .10

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 5.6

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 5.6

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 5.2

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: .10

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 5.5

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
 *              in the default handler.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 4.7

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 4.2

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: .10

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 5.4

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 3.9

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 3.2

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: .10

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 5.3

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 * @since 5.3.0 The `$charset` argument was added.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 2.3

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 *
 * @global WP_Query $wp_query Global WP_Query instance.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: .20

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 *
 * @global WP_Query $wp_query Global WP_Query instance.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 2.2

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 *
 * @global WP_Query $wp_query Global WP_Query instance.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: .12

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 *
 * @global WP_Query $wp_query Global WP_Query instance.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('REST_REQUEST') && REST_REQUEST && wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP REST requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 5.2

/**
 * Kills WordPress execution and displays HTML page with an error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 *
 * @global WP_Query $wp_query Global WP_Query instance.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    global $wp_query;
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (wp_is_jsonp_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSONP requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_jsonp_handler', '_jsonp_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } elseif (wp_is_xml_request() || isset($wp_query) && (function_exists('is_feed') && is_feed() || function_exists('is_comment_feed') && is_comment_feed() || function_exists('is_trackback') && is_trackback())) {
        /**
         * Filters the callback for killing WordPress execution for XML requests.
         *
         * @since 5.2.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xml_handler', '_xml_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 5.1

/**
 * Kill WordPress execution and display HTML message with error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type string $link_url       A URL to include a link to. Only works in combination with $link_text.
 *                                  Default empty string.
 *     @type string $link_text      A label for the link to include. Only works in combination with $link_url.
 *                                  Default empty string.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 *     @type string $code           Error code to use. Default is 'wp_die', or the main error code if $message
 *                                  is a WP_Error.
 *     @type bool   $exit           Whether to exit the process after completion. Default true.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (wp_is_json_request()) {
        /**
         * Filters the callback for killing WordPress execution for JSON requests.
         *
         * @since 5.1.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_json_handler', '_json_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-XML-RPC requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 4.7

/**
 * Kill WordPress execution and display HTML message with error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
 *                                  Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (wp_doing_ajax()) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-XML-RPC requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 4.6

/**
 * Kill WordPress execution and display HTML message with error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
 *                                  the error's messages are used. Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 500.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of is_rtl().
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (defined('DOING_AJAX') && DOING_AJAX) {
        /**
         * Filters the callback for killing WordPress execution for Ajax requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filters the callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } else {
        /**
         * Filters the callback for killing WordPress execution for all non-Ajax, non-XML-RPC requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 4.4

/**
 * Kill WordPress execution and display HTML message with error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a {@see WP_Error} object,
 *                                  the error's messages are used. Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 500.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of {@see is_rtl()}.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (defined('DOING_AJAX') && DOING_AJAX) {
        /**
         * Filter callback for killing WordPress execution for AJAX requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filter callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } else {
        /**
         * Filter callback for killing WordPress execution for all non-AJAX, non-XML-RPC requests.
         *
         * @since 3.0.0
         *
         * @param callable $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 4.1

/**
 * Kill WordPress execution and display HTML message with error message.
 *
 * This function complements the `die()` PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only when the execution should not continue any further. It is not recommended
 * to call this function very often, and try to handle as many errors as possible
 * silently or more gracefully.
 *
 * As a shorthand, the desired HTTP response code may be passed as an integer to
 * the `$title` parameter (the default title would apply) or the `$args` parameter.
 *
 * @since 2.0.4
 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
 *              an integer to be used as the response code.
 *
 * @param string|WP_Error  $message Optional. Error message. If this is a {@see WP_Error} object,
 *                                  the error's messages are used. Default empty.
 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
 *                                  error data with the key 'title' may be used to specify the title.
 *                                  If `$title` is an integer, then it is treated as the response
 *                                  code. Default empty.
 * @param string|array|int $args {
 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
 *     as the response code. Default empty array.
 *
 *     @type int    $response       The HTTP response code. Default 500.
 *     @type bool   $back_link      Whether to include a link to go back. Default false.
 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
 *                                  Default is the value of {@see is_rtl()}.
 * }
 */
function wp_die($message = '', $title = '', $args = array())
{
    if (is_int($args)) {
        $args = array('response' => $args);
    } elseif (is_int($title)) {
        $args = array('response' => $title);
        $title = '';
    }
    if (defined('DOING_AJAX') && DOING_AJAX) {
        /**
         * Filter callback for killing WordPress execution for AJAX requests.
         *
         * @since 3.4.0
         *
         * @param callback $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filter callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callback $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } else {
        /**
         * Filter callback for killing WordPress execution for all non-AJAX, non-XML-RPC requests.
         *
         * @since 3.0.0
         *
         * @param callback $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 4.0

/**
 * Kill WordPress execution and display HTML message with error message.
 *
 * This function complements the die() PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only, when the execution should not continue any further. It is not
 * recommended to call this function very often and try to handle as many errors
 * as possible silently.
 *
 * @since 2.0.4
 *
 * @param string       $message Optional. Error message. Default empty.
 * @param string       $title   Optional. Error title. Default empty.
 * @param string|array $args    Optional. Arguments to control behavior. Default empty array.
 */
function wp_die($message = '', $title = '', $args = array())
{
    if (defined('DOING_AJAX') && DOING_AJAX) {
        /**
         * Filter callback for killing WordPress execution for AJAX requests.
         *
         * @since 3.4.0
         *
         * @param callback $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filter callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callback $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } else {
        /**
         * Filter callback for killing WordPress execution for all non-AJAX, non-XML-RPC requests.
         *
         * @since 3.0.0
         *
         * @param callback $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 3.9

/**
 * Kill WordPress execution and display HTML message with error message.
 *
 * This function complements the die() PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only, when the execution should not continue any further. It is not
 * recommended to call this function very often and try to handle as many errors
 * as possible silently.
 *
 * @since 2.0.4
 *
 * @param string $message Error message.
 * @param string $title Error title.
 * @param string|array $args Optional arguments to control behavior.
 */
function wp_die($message = '', $title = '', $args = array())
{
    if (defined('DOING_AJAX') && DOING_AJAX) {
        /**
         * Filter callback for killing WordPress execution for AJAX requests.
         *
         * @since 3.4.0
         *
         * @param callback $function Callback function name.
         */
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        /**
         * Filter callback for killing WordPress execution for XML-RPC requests.
         *
         * @since 3.4.0
         *
         * @param callback $function Callback function name.
         */
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } else {
        /**
         * Filter callback for killing WordPress execution for all non-AJAX, non-XML-RPC requests.
         *
         * @since 3.0.0
         *
         * @param callback $function Callback function name.
         */
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}

WordPress Version: 3.7

/**
 * Kill WordPress execution and display HTML message with error message.
 *
 * This function complements the die() PHP function. The difference is that
 * HTML will be displayed to the user. It is recommended to use this function
 * only, when the execution should not continue any further. It is not
 * recommended to call this function very often and try to handle as many errors
 * as possible silently.
 *
 * @since 2.0.4
 *
 * @param string $message Error message.
 * @param string $title Error title.
 * @param string|array $args Optional arguments to control behavior.
 */
function wp_die($message = '', $title = '', $args = array())
{
    if (defined('DOING_AJAX') && DOING_AJAX) {
        $function = apply_filters('wp_die_ajax_handler', '_ajax_wp_die_handler');
    } elseif (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        $function = apply_filters('wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler');
    } else {
        $function = apply_filters('wp_die_handler', '_default_wp_die_handler');
    }
    call_user_func($function, $message, $title, $args);
}