Kills WordPress execution and displays the specified HTML 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.
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
$title(string|int)
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
$args(string|array|int)
Arguments to control behavior. If $args is an integer, then it is treated as the response code.
Default: empty array
response(int)
The HTTP response code. Default: 200 for Ajax requests, 500 otherwise
link_url(string)
A URL to include a link to. Only works in combination with $link_text. Default: empty string
link_text(string)
A label for the link to include. Only works in combination with $link_url. Default: empty string
back_link(true|false)
Whether to include a link to go back. Default: false
text_direction(string)
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: value of is_rtl()
charset(string)
Character set of the HTML output. Default: 'utf-8'
code(string)
Error code to use. Default: 'wp_die', or the main error code if $message is a WP_Error
exit(true|false)
Whether to exit the process after completion. Default: true