Index: src/wp-includes/class-wp-error.php
===================================================================
--- src/wp-includes/class-wp-error.php	(revision 42644)
+++ src/wp-includes/class-wp-error.php	(working copy)
@@ -31,7 +31,7 @@
 	 *
 	 * @since 2.1.0
 	 * @var array
-	 */
+ 	 */
 	public $error_data = array();
 
 	/**
@@ -71,7 +71,7 @@
 	 * @return array List of error codes, if available.
 	 */
 	public function get_error_codes() {
-		if ( empty( $this->errors ) ) {
+		if ( ! $this->has_errors() ) {
 			return array();
 		}
 
@@ -162,6 +162,20 @@
 	}
 
 	/**
+	 * Verify if instance contains errors.
+	 *
+	 * @since 5.0.0
+	 *
+	 * @return bool
+	 */
+	public function has_errors() {
+		if ( ! empty( $this->errors ) ) {
+			return true;
+		}
+		return false;
+	}
+
+	/**
 	 * Add an error or append additional message to an existing error.
 	 *
 	 * @since 2.1.0
Index: tests/phpunit/tests/general/wpError.php
===================================================================
--- tests/phpunit/tests/general/wpError.php	(revision 42646)
+++ tests/phpunit/tests/general/wpError.php	(working copy)
@@ -412,6 +412,21 @@
 	}
 
 	/**
+	 * @covers ::has_errors()
+	 */
+	public function test_has_errors_with_no_errors_returns_false() {
+		$this->assertFalse( $this->WP_Error->has_errors() );
+	}
+
+	/**
+	 * @covers ::has_errors()
+	 */
+	public function test_has_errors_with_errors_returns_true() {
+		$this->WP_Error->add( 'code', 'message', 'data' );
+		$this->assertTrue( $this->WP_Error->has_errors() );
+	}
+
+	/**
 	 * @covers ::add()
 	 */
 	public function test_add_with_code_empty_message_empty_data_should_add_error_with_code() {
