W3cubDocs

/WordPress

WP_Error::has_errors()

Verify if the instance contains errors.

Return

(bool)

Source

File: wp-includes/class-wp-error.php

public function has_errors() {
		if ( ! empty( $this->errors ) ) {
			return true;
		}
		return false;
	}

Changelog

Version Description
5.1.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_error/has_errors