WP_Error::has_errors() WordPress Method
The WP_Error::has_errors() method is used to check whether a given WordPress error object has any errors. This is useful for checking whether an error has occurred before attempting to get the error message.
WP_Error::has_errors() #
Verifies if the instance contains errors.
Return
(bool) If the instance contains errors.
Source
File: wp-includes/class-wp-error.php
public function has_errors() { if ( ! empty( $this->errors ) ) { return true; } return false; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.1.0 | Introduced. |