wp_die( string|WP_Error|int $message = '', string|int $title = '', string|array|int $args = array() ): void
- Since
- 2.0.4, 4.1.0, 5.1.0, 5.3.0, 5.5.0
- Source
wp-includes/functions.php:3820
Halts execution and renders an HTML error screen built from $message and $title, exiting PHP by default. Passing an integer for $title or $args sets the HTTP response code as a shorthand for array('response' => code). Ajax, JSON, JSONP REST, XML-RPC and feed requests are each detected automatically and routed through a different filterable output handler, so the same call can produce JSON instead of an HTML page depending on context.
Description
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.
Compatibility
- WordPress
- since 5.5.0
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Parameters
$messagestring|WP_Error|intoptional- Error message. If this is a WP_Error object, and not an Ajax or XML-RPC request, the error's messages are used.
An integer is echoed as the entire response body by legacy Ajax handlers, which use -1 for a failed nonce or capability check, 0 for failure, and 1 for success. Default empty string.Default:'' $titlestring|intoptional- Error title. If
$messageis aWP_Errorobject, error data with the key 'title' may be used to specify the title.
If$titleis an integer, then it is treated as the response code.
Default empty string.Default:'' $argsstring|array|intoptional- Arguments to control behavior. If
$argsis an integer, then it is treated as the response code. Default empty array.Default:array()$responseintdefault: 200 for Ajax requests, 500 otherwiseThe HTTP response code.$link_urlstringdefault: empty stringA URL to include a link to. Only works in combination with $link_text.$link_textstringdefault: empty stringA label for the link to include. Only works in combination with $link_url.$back_linkbooldefault: falseWhether to include a link to go back.$text_directionstringdefault: is the value of is_rtl()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'.$charsetstringdefault: 'utf-8'Character set of the HTML output.$codestringdefault: is 'wp_die', or the main error code if $message is a WP_ErrorError code to use.$exitbooldefault: trueWhether to exit the process after completion.
Return value
void- Never returns if
$args['exit']is true (the default), otherwise returns void.
Code examples
Every example is editable and runs in a real WordPress booted in your browser by WordPress Playground. Press Run, then edit the code: clicking away re-runs it. Nothing is sent anywhere until you do.
Die with a WP_Error and a 404 response code when a post is missing
Look up a post that does not exist in the baseline fixtures and stop the request with a formatted error screen.
$post_id = 999999;
$post = get_post( $post_id );
if ( ! $post ) {
$error = new WP_Error(
'invalid_post',
sprintf( 'No post exists with ID %d.', $post_id ),
array( 'title' => 'Post Not Found' )
);
wp_die( $error, '', array( 'response' => 404, 'back_link' => true ) );
}
echo esc_html( $post->post_title );Because $args['exit'] defaults to true, nothing written after this call in the current request will run.
Use the integer shorthand for a 403 response code in a capability check
Guard a settings page with current_user_can() and pass the HTTP status directly as $title.
$can_manage = current_user_can( 'manage_options' );
if ( ! $can_manage ) {
wp_die( 'You do not have permission to view this settings page.', 403 );
}
$price = get_post_meta( 2, 'price', true );
echo esc_html( 'Access granted. Stored price meta for post 2 is: ' . $price );The logged in administrator in the sandbox passes the check, so this prints the meta value instead of dying; try it with a lower-privileged user to see the 403 screen.
Common problems and fixes · 4
- Why does the rest of my code stop running after wp_die()?
- Why isn't my WP_Error message showing up when I pass it to wp_die()?
- Why did calling wp_die() output JSON instead of the styled HTML error page I expected?
- Why does the response code I passed get overridden with 200 or 500?
Why does the rest of my code stop running after wp_die()?
Why isn't my WP_Error message showing up when I pass it to wp_die()?
Why did calling wp_die() output JSON instead of the styled HTML error page I expected?
Why does the response code I passed get overridden with 200 or 500?
Alternatives and related functions
WP_Error- When you need to build a structured error with a code, message, and extra data (like a 'title') before deciding whether to hand it to wp_die() or handle it another way.
wp_send_json_error- When you are inside an Ajax callback and want a JSON error response without manually branching on wp_doing_ajax().
status_header- When you only need to send an HTTP status code and keep executing PHP afterward, without halting the request or rendering an error message.
WP_Ajax_Response- When building a legacy XML Ajax response, as used internally by admin-ajax handlers, instead of terminating with an HTML or JSON die screen.
Performance profile
How much work a call to wp_die() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Trivial
- Scaling
- Constant
- Instructions
- 23–65
- Plugin surface
- 6 hooks
- Called by
- 50
Touches nothing outside its own arguments.
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 97.
Third-party callbacks on 'wp_die_ajax_handler', 'wp_die_json_handler', 'wp_die_jsonp_handler' run inside this call, and their cost is not bounded by anything here.
50 places in core call this, so the cost is paid more often than your own code shows.
What it touches
- hookthird-party callbacks
apply_filters()called directly
Further down the call graph this can also reach query, option, cache, serialize and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 28 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost wp_die() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
wp_doing_ajax() | 23–26 | wp_doing_ajax(), apply_filters(), call_user_func() |
!wp_doing_ajax() && wp_is_json_request() | 26–29 | wp_doing_ajax(), wp_is_json_request(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && wp_is_serving_rest_request() | 32–39 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_jsonp_request(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && !wp_is_serving_rest_request() && defined('XMLRPC_REQUEST') | 33–36 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && !wp_is_serving_rest_request() | 34–40 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_xml_request(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && wp_is_serving_rest_request() && !wp_is_jsonp_request() | 37–43 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_jsonp_request(), wp_is_xml_request(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && !wp_is_serving_rest_request() && !wp_is_xml_request() && isset($wp_query) && function_exists() && is_feed() | 43–48 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_xml_request(), function_exists(), is_feed(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && wp_is_serving_rest_request() && !wp_is_jsonp_request() && !wp_is_xml_request() && isset($wp_query) && function_exists() && is_feed() | 46–51 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_jsonp_request(), wp_is_xml_request(), function_exists(), is_feed(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && !wp_is_serving_rest_request() && !wp_is_xml_request() && isset($wp_query) && !function_exists() | 47–52 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_xml_request(), function_exists(), function_exists(), function_exists(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && !wp_is_serving_rest_request() && !wp_is_xml_request() && isset($wp_query) && is_comment_feed() | 47–52 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_xml_request(), function_exists(), function_exists(), is_comment_feed(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && !wp_is_serving_rest_request() && !wp_is_xml_request() && isset($wp_query) | 50–56 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_xml_request(), function_exists(), function_exists(), function_exists(), is_trackback(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && !wp_is_serving_rest_request() && !wp_is_xml_request() && isset($wp_query) && !is_comment_feed() | 50–55 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_xml_request(), function_exists(), function_exists(), is_comment_feed(), function_exists(), apply_filters(), call_user_func() |
16 further outcomes, up to 65 instructions
!wp_doing_ajax() && !wp_is_json_request() && !wp_is_serving_rest_request() && !wp_is_xml_request() && isset($wp_query) && !is_feed() | 50–55 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_xml_request(), function_exists(), is_feed(), function_exists(), function_exists(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && !wp_is_serving_rest_request() && !wp_is_xml_request() && isset($wp_query) && function_exists() && !is_feed() && is_comment_feed() | 50–55 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_xml_request(), function_exists(), is_feed(), function_exists(), is_comment_feed(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && wp_is_serving_rest_request() && !wp_is_jsonp_request() && !wp_is_xml_request() && isset($wp_query) && !function_exists() | 50–55 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_jsonp_request(), wp_is_xml_request(), function_exists(), function_exists(), function_exists(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && wp_is_serving_rest_request() && !wp_is_jsonp_request() && !wp_is_xml_request() && isset($wp_query) && is_comment_feed() | 50–55 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_jsonp_request(), wp_is_xml_request(), function_exists(), function_exists(), is_comment_feed(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && !wp_is_serving_rest_request() && !wp_is_xml_request() && isset($wp_query) && !is_comment_feed() | 53–59 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_xml_request(), function_exists(), function_exists(), is_comment_feed(), function_exists(), is_trackback(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && !wp_is_serving_rest_request() && !wp_is_xml_request() && isset($wp_query) && !is_feed() | 53–59 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_xml_request(), function_exists(), is_feed(), function_exists(), function_exists(), is_trackback(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && !wp_is_serving_rest_request() && !wp_is_xml_request() && isset($wp_query) && !is_feed() && !is_comment_feed() | 53–58 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_xml_request(), function_exists(), is_feed(), function_exists(), is_comment_feed(), function_exists(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && wp_is_serving_rest_request() && !wp_is_jsonp_request() && !wp_is_xml_request() && isset($wp_query) | 53–59 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_jsonp_request(), wp_is_xml_request(), function_exists(), function_exists(), function_exists(), is_trackback(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && wp_is_serving_rest_request() && !wp_is_jsonp_request() && !wp_is_xml_request() && isset($wp_query) && !is_comment_feed() | 53–58 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_jsonp_request(), wp_is_xml_request(), function_exists(), function_exists(), is_comment_feed(), function_exists(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && wp_is_serving_rest_request() && !wp_is_jsonp_request() && !wp_is_xml_request() && isset($wp_query) && !is_feed() | 53–58 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_jsonp_request(), wp_is_xml_request(), function_exists(), is_feed(), function_exists(), function_exists(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && wp_is_serving_rest_request() && !wp_is_jsonp_request() && !wp_is_xml_request() && isset($wp_query) && function_exists() && !is_feed() && is_comment_feed() | 53–58 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_jsonp_request(), wp_is_xml_request(), function_exists(), is_feed(), function_exists(), is_comment_feed(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && !wp_is_serving_rest_request() && !wp_is_xml_request() && isset($wp_query) && function_exists() && !is_feed() && !is_comment_feed() | 56–62 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_xml_request(), function_exists(), is_feed(), function_exists(), is_comment_feed(), function_exists(), is_trackback(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && wp_is_serving_rest_request() && !wp_is_jsonp_request() && !wp_is_xml_request() && isset($wp_query) && !is_comment_feed() | 56–62 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_jsonp_request(), wp_is_xml_request(), function_exists(), function_exists(), is_comment_feed(), function_exists(), is_trackback(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && wp_is_serving_rest_request() && !wp_is_jsonp_request() && !wp_is_xml_request() && isset($wp_query) && !is_feed() | 56–62 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_jsonp_request(), wp_is_xml_request(), function_exists(), is_feed(), function_exists(), function_exists(), is_trackback(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && wp_is_serving_rest_request() && !wp_is_jsonp_request() && !wp_is_xml_request() && isset($wp_query) && !is_feed() && !is_comment_feed() | 56–61 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_jsonp_request(), wp_is_xml_request(), function_exists(), is_feed(), function_exists(), is_comment_feed(), function_exists(), apply_filters(), call_user_func() |
!wp_doing_ajax() && !wp_is_json_request() && wp_is_serving_rest_request() && !wp_is_jsonp_request() && !wp_is_xml_request() && isset($wp_query) && function_exists() && !is_feed() && !is_comment_feed() | 59–65 | wp_doing_ajax(), wp_is_json_request(), wp_is_serving_rest_request(), wp_is_jsonp_request(), wp_is_xml_request(), function_exists(), is_feed(), function_exists(), is_comment_feed(), function_exists(), is_trackback(), apply_filters(), call_user_func() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 97 | 23–65 | 16 | |
| 8.5 | 97 | 23–65 | 16 | |
| 8.4 | 97 | 23–65 | 16 | |
| 8.3 | 97 | 23–65 | 16 | |
| 8.2 | 97 | 23–65 | 16 | |
| 8.1 | 97 | 23–65 | 16 | 3 fewer instructions than PHP 7.4 |
| 7.4 | 100 | 23–68 | 16 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Hooks and filters fired · 6
6 hooks fire while wp_die() runs, in this order:
- apply_filters( wp_die_ajax_handler )filterline 3838 (+18 into the body)
Filters the callback for killing WordPress execution for Ajax requests.
- apply_filters( wp_die_json_handler )filterline 3847 (+27 into the body)
Filters the callback for killing WordPress execution for JSON requests.
- apply_filters( wp_die_jsonp_handler )filterline 3856 (+36 into the body)
Filters the callback for killing WordPress execution for JSONP REST requests.
- apply_filters( wp_die_xmlrpc_handler )filterline 3865 (+45 into the body)
Filters the callback for killing WordPress execution for XML-RPC requests.
- apply_filters( wp_die_xml_handler )filterline 3878 (+58 into the body)
Filters the callback for killing WordPress execution for XML requests.
- apply_filters( wp_die_handler )filterline 3887 (+67 into the body)
Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
Uses · 9
- wp_doing_ajax()Determines whether the current request is a WordPress Ajax request.
- apply_filters()Calls the callback functions that have been added to a filter hook.
- wp_is_json_request()Checks whether current request is a JSON request, or is expecting a JSON response.
- wp_is_serving_rest_request()Determines whether WordPress is currently serving a REST API request.
- wp_is_jsonp_request()Checks whether current request is a JSONP request, or is expecting a JSONP response.
- wp_is_xml_request()Checks whether current request is an XML request, or is expecting an XML response.
- is_feed()Determines whether the query is for a feed.
- is_comment_feed()Is the query for a comments feed?
- is_trackback()Determines whether the query is for a trackback endpoint call.
Used by · 50
- Custom_Background::handle_upload()Handles an Image upload for the background image.
- Custom_Image_Header::admin_page()Displays the page based on the current step.
- Custom_Image_Header::step_2()Displays second step of custom header image page.
- Custom_Image_Header::step_2_manage_upload()Uploads the file to be cropped in the second step.
- Custom_Image_Header::step_3()Displays third step of custom header image page.
- File_Upload_Upgrader::__construct()Construct the upgrader for a form.
- WP::parse_request()Parses the request to find the correct WordPress query.
- WP_Ajax_Response::send()Display XML formatted responses.
- WP_Customize_Manager::handle_load_themes_request()Loads themes into the theme browsing/installation UI.
- WP_Customize_Manager::setup_theme()Starts preview and customize theme.
- WP_Customize_Manager::wp_die()Custom wp_die wrapper. Returns either the standard message for UI or the Ajax message.
- WP_Customize_Nav_Menus::ajax_load_available_items()Ajax handler for loading available menu items.
Show all 50
- WP_Customize_Nav_Menus::ajax_search_available_items()Ajax handler for searching available menu items.
- WP_Customize_Widgets::wp_ajax_update_widget()Updates widget settings asynchronously.
- WP_Fatal_Error_Handler::display_default_error_template()Displays the default PHP error template.
- WP_Recovery_Mode::handle_cookie()Handles checking for the recovery mode cookie and validating it.
- WP_Recovery_Mode::handle_exit_recovery_mode()Handles a request to exit Recovery Mode.
- WP_Recovery_Mode_Link_Service::handle_begin_link()Enters recovery mode when the user hits wp-login.php with a valid recovery mode link.
- WP_Screen::get()Fetches a screen object.
- WP_Sitemaps_Renderer::check_for_simple_xml_availability()Checks for the availability of the SimpleXML extension and errors if missing.
- WP_Terms_List_Table::__construct()Constructor.
- WP_Theme_Install_List_Table::prepare_items()
- _access_denied_splash()Displays an access denied message when a user tries to view a site's dashboard they do not have access to.
- _show_post_preview()Filters the latest content for preview from the post autosave.
- _wp_ajax_add_hierarchical_term()Handles adding a hierarchical term via AJAX.
- bulk_edit_posts()Processes the post data for the bulk editing of posts.
- check_ajax_referer()Verifies the Ajax request to prevent processing requests external of the blog.
- check_upload_size()Determines whether uploaded file exceeds space quota.
- confirm_delete_users()
- dead_db()Loads custom DB error or display WordPress DB error.
- do_feed()Loads the feed template from the use of an action hook.
- edit_comment()Updates a comment with values provided in $_POST.
- edit_link()Updates or inserts a link using values provided in $_POST.
- edit_post()Updates an existing post with values provided in `$_POST`.
- edit_user()Edit user settings based on contents of $_POST
- get_default_post_to_edit()Returns default post information to use when populating the "Write Post" form.
- install_plugin_information()Displays plugin information in dialog box form.
- install_theme_information()Displays theme information in dialog box form.
- maybe_add_existing_user_to_blog()Adds a new user to a blog by visiting /newbloguser/{key}/.
- ms_not_installed()Displays a failure message.
- ms_site_check()Checks status of current blog.
- post_preview()Saves a draft or manually autosaves for the purpose of showing a post preview.
- rest_api_loaded()Loads the REST API.
- switch_theme()Switches the theme.
- twenty_twenty_one_customize()Prevents the Customizer from being loaded on WordPress versions prior to 5.3.
- twenty_twenty_one_preview()Prevents the Theme Preview from being loaded on WordPress versions prior to 5.3.
- twentyfifteen_customize()Prevents the Customizer from being loaded on WordPress versions prior to 4.1.
- twentyfifteen_preview()Prevents the Theme Preview from being loaded on WordPress versions prior to 4.1.
- twentyfourteen_customize()Prevents the Customizer from being loaded on WordPress versions prior to 3.6.
- twentyfourteen_preview()Prevents the Theme Preview from being loaded on WordPress versions prior to 3.4.
Source code
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 );}Changelog
Introduced in 2.0.4. 3 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
$message retyped from string|WP_Error to string|WP_Error|int.verified against sourcenever|void to void.verified against sourcenone to never|void.verified against source$text_direction argument has a priority over get_language_attributes() in the default handler.from the docblock$charset argument was added.from the docblock$link_url, $link_text, and $exit arguments were added.from the docblock$title and $args parameters were changed to optionally accept an integer to be used as the response code.from the docblockAbout this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/functions.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.