WP_Error::get_error_codes() WordPress Method

The WP_Error::get_error_codes() method returns an array of all the error codes that have been set on the WP_Error object.

WP_Error::get_error_codes() #

Retrieves all error codes.


Return

(array) List of error codes, if available.


Top ↑

Source

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

	public function get_error_codes() {
		if ( ! $this->has_errors() ) {
			return array();
		}

		return array_keys( $this->errors );
	}


Top ↑

Changelog

Changelog
VersionDescription
2.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.