wpdb::suppress_errors() WordPress Method
The wpdb::suppress_errors() method is a Boolean flag that, when set to true, prevents the display of database errors. This is useful for debugging purposes, as it prevents the display of database error messages that might give away sensitive information. Note that this does not prevent the actual database errors from happening, it just prevents them from being displayed.
wpdb::suppress_errors( bool $suppress = true ) #
Enables or disables suppressing of database errors.
Description
By default database errors are suppressed.
See also
Parameters
- $suppress
(bool)(Optional) Whether to suppress errors.
Default value: true
Return
(bool) Whether suppressing of errors was previously active.
Source
File: wp-includes/wp-db.php
public function suppress_errors( $suppress = true ) { $errors = $this->suppress_errors; $this->suppress_errors = (bool) $suppress; return $errors; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |