WordPress at a glance
function is not described

WP_Customize_Manager::wp_die() protected WP 3.4.0

Custom wp_die wrapper. Returns either the standard message for UI or the Ajax message.

{} It's a method of the class: WP_Customize_Manager{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->wp_die( $ajax_message, $message );
$ajax_message(string|WP_Error) (required)
Ajax return.
$message(string)
UI message.

Changelog

Since 3.4.0 Introduced.

Code of WP_Customize_Manager::wp_die() WP 5.7.2

<?php
protected function wp_die( $ajax_message, $message = null ) {
	if ( $this->doing_ajax() ) {
		wp_die( $ajax_message );
	}

	if ( ! $message ) {
		$message = __( 'Something went wrong.' );
	}

	if ( $this->messenger_channel ) {
		ob_start();
		wp_enqueue_scripts();
		wp_print_scripts( array( 'customize-base' ) );

		$settings = array(
			'messengerArgs' => array(
				'channel' => $this->messenger_channel,
				'url'     => wp_customize_url(),
			),
			'error'         => $ajax_message,
		);
		?>
		<script>
		( function( api, settings ) {
			var preview = new api.Messenger( settings.messengerArgs );
			preview.send( 'iframe-loading-error', settings.error );
		} )( wp.customize, <?php echo wp_json_encode( $settings ); ?> );
		</script>
		<?php
		$message .= ob_get_clean();
	}

	wp_die( $message );
}