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.
See also
Parameters
- $show
(bool)(Optional) Whether to show errors.
Default value: true
Return
(bool) Whether showing of errors was previously active.
Source
File: wp-includes/wp-db.php
public function show_errors( $show = true ) { $errors = $this->show_errors; $this->show_errors = $show; return $errors; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
0.71 | Introduced. |