_scalar_wp_die_handler()WP 3.4.0

Kills WordPress execution and displays an error message.

This is the handler for wp_die() when processing APP requests.

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Return

null. Nothing (null).

Usage

_scalar_wp_die_handler( $message, $title, $args );
$message(string)
Response to print.
Default: empty string
$title(string)
Error title (unused).
Default: empty string
$args(string|array)
Arguments to control behavior.
Default: empty array

Changelog

Since 3.4.0 Introduced.
Since 5.1.0 Added the $title and $args parameters.

_scalar_wp_die_handler() code WP 6.5.4

function _scalar_wp_die_handler( $message = '', $title = '', $args = array() ) {
	list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args );

	if ( $parsed_args['exit'] ) {
		if ( is_scalar( $message ) ) {
			die( (string) $message );
		}
		die();
	}

	if ( is_scalar( $message ) ) {
		echo (string) $message;
	}
}