wpdb::bail( string $message, string $error_code = '500' )

Wraps errors in a nice header and footer and dies.


Description Description

Will not die if wpdb::$show_errors is false.


Parameters Parameters

$message

(string) (Required) The Error message

$error_code

(string) (Optional) A Computer readable string to identify the error.

Default value: '500'


Top ↑

Return Return

(false|void)


Top ↑

Source Source

File: wp-includes/wp-db.php

	public function bail( $message, $error_code = '500' ) {
		if ( !$this->show_errors ) {
			if ( class_exists( 'WP_Error', false ) ) {
				$this->error = new WP_Error($error_code, $message);
			} else {
				$this->error = $message;
			}
			return false;
		}
		wp_die($message);
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.5.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.