wpdb::show_errors() WordPress Method

The wpdb::show_errors() method is a WordPress core method used to turn on display of database errors. By default, database errors are not displayed to the user. However, they are logged to the WordPress error log. Calling this method will cause database errors to be displayed to the user in addition to being logged.

wpdb::show_errors( bool $show = true ) #

Enables showing of database errors.


Description

This function should be used only to enable showing of errors. wpdb::hide_errors() should be used instead for hiding errors.

Top ↑

See also


Top ↑

Parameters

$show

(bool)(Optional) Whether to show errors.

Default value: true


Top ↑

Return

(bool) Whether showing of errors was previously active.


Top ↑

Source

File: wp-includes/wp-db.php

	public function show_errors( $show = true ) {
		$errors            = $this->show_errors;
		$this->show_errors = $show;
		return $errors;
	}


Top ↑

Changelog

Changelog
VersionDescription
0.71Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.