wp_die

Definition:
function wp_die( $message, $title = '', $args = array() {}

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.

Parameters

  • string $message: Error message.
  • string $title: Error title.
  • string|array $args: Optional arguments to control behavior.

Defined filters

  • wp_die_handler
    apply_filters( 'wp_die_handler', '_default_wp_die_handler')

Source code

function wp_die( $message, $title = '', $args = array() ) {

	if ( defined( 'DOING_AJAX' ) && DOING_AJAX )

		die('-1');



	if ( function_exists( 'apply_filters' ) ) {

		$function = apply_filters( 'wp_die_handler', '_default_wp_die_handler');

	} else {

		$function = '_default_wp_die_handler';

	}



	call_user_func( $function, $message, $title, $args );

}

3607

No comments yet... Be the first to leave a reply!

Leave a comment